Hi, i need to have an extra service to serve my Upload Applet Requests.
I´ve made a service with the following service method code:
I´ve made a service with the following service method code:
Quote: |
public void service(IRequestCycle cycle) { System.out.println("UploadServiceImpl.service()"); DefaultFileItemFactory factory = new DefaultFileItemFactory(); factory.setRepository(new File(mFileManager.getUploadPath())); factory.setSizeThreshold(50000); DiskFileUpload lDiskFileUpload = new DiskFileUpload(factory); lDiskFileUpload.setSizeMax(mFileManager.getMaxUploadSize()); try { List <FileItem > items = lDiskFileUpload.parseRequest(request); for (FileItem item : items) { System.out.println(item.getFieldName()); System.out.println(item.getName()); } } catch (FileUploadException e) { e.printStackTrace(); } |
The problem is that the request seems to be empty. I tried to copy the whole request stream to a local directory but the file had the size of 0.
I inject the Request into my Upload service like this:
Quote: |
<set-service property="request" service-id="tapestry.globals.HttpServletRequest" /> |
Or can i hook into the Upload
Component?
Any suggestions?
Thanks