Re: File Download with multiple files. Design question

2010-11-21 Thread Paweł Wielgus
Hi Roger, below is Off-Topic as for struts. > That's what I'm doing, but the StreamResult requires an InputStream > which forces the intermediate step of creating a temporary file I'm not so sure, i haven't done it myself, but there were a discussion here some time ago pointing out that one can c

Re: File Download with multiple files. Design question

2010-11-20 Thread Roger Varley
On Sat, 2010-11-20 at 09:41 +0100, Paweł Wielgus wrote: > Hi All, > read about streamResult (I assume You use struts2), and also there is > no need for next action in chain, user can simply check as many files > as he wants and click download what will call downloadAction that will > simply return

Re: File Download with multiple files. Design question

2010-11-20 Thread Li Ying
> Any examples of doing this in struts 2 You can get the HttpServletResponse by: ServletActionContext.getResponse() And then, you can set the download file name, by: response.setHeader("Content-Disposition", "attachment; filename=" + fileName); And then, you can get the Out

Re: File Download with multiple files. Design question

2010-11-20 Thread Paweł Wielgus
Hi All, read about streamResult (I assume You use struts2), and also there is no need for next action in chain, user can simply check as many files as he wants and click download what will call downloadAction that will simply return zip file for download, after downoading user is still at the same

Re: File Download with multiple files. Design question

2010-11-19 Thread RogerV
Li Ying wrote: > > My suggestion: > > (1)I believe you can use ZipOutputStream to output the zipped data to > the response OutputStream directly, instead of a temp file. So no temp > file need to be created. > Hmm, write to the response.outputStream directly from within my action? That would

Re: File Download with multiple files. Design question

2010-11-19 Thread Li Ying
My suggestion: (1)I believe you can use ZipOutputStream to output the zipped data to the response OutputStream directly, instead of a temp file. So no temp file need to be created. OR (2)You can create a batch application, repeatedly run it with some interval (use cron or something). And in this

Re: File Download with multiple files. Design question

2010-11-19 Thread Rahul Mohan
Roger, In my project, we implemented a FileManager for storing, retrieving and cleaning up files. On upload, the filemanager creates a temp file on disk and stores the file-URL in a map correlated with the session id. We also implemented a SessionListener which calls FileManager.deleteFiles()