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
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
> 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
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
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
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
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()
7 matches
Mail list logo