That won't work (I don't believe so anyways).

You are better off displaying a page with a list of links to these files and
generate each one separately on a per request basis.  The other thing to
maybe look at is generating the file data as separate files, then use
common's compress:

http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/compress/

To stream back a single zip.  I think onjava or google might have an article
on creating zip files.

The other thing to do is if you are using servlet 2.3 spec with filters,
look at using a gzip filter to speed up downloads from your application.
Javaworld has an article on this with sample code from Jason Hunter.

Jacob Hookom
Senior Analyst/Programmer
McKesson Medical-Surgical
Golden Valley, Minnesota
http://www.mckesson.com

-----Original Message-----
From: Jerry Jalenak [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 04, 2003 9:29 AM
To: 'Struts Users Mailing List'
Subject: RE: [OT] RE: File Download?

Jacob - 

Knew it had to be something easy  8-)

Second question - One of my requirements is that my users need to ability to
select multiple files from a list of available files.  I need to be able to
store each selected file individually on their hard drive.  Using your
approach, can I flush the response buffer between each file in order to do
this?  Something along these lines:

<pseudo-code>

        get the requested filename(s)
        while (more filenames)
        {
                retrieve the file
                set the content type
                set the header
                flush the response buffer (leaving the connection open)
        }

</pseudo-code>

Thanks!

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


> -----Original Message-----
> From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 04, 2003 9:04 AM
> To: Struts Users Mailing List
> Subject: [OT] RE: File Download?
> 
> 
> This is what we use for file downloads (Excel/PDF files).
> 
> String contentType = this.beanWriter.getContentType();
> response.setContentType(contentType);
> response.setHeader("Content-Disposition","attachment;filename=\""
>       + this.beanWriter.getFileName(request) + "\"");
> 
> And have your struts action return null.
> 
> -Jacob
> 
> -----Original Message-----
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, December 04, 2003 9:05 AM
> To: '[EMAIL PROTECTED]'
> Subject: File Download?
> 
> I have a need to send generated image files from my web 
> server to a file
> stored on a users local hard drive - ie file download.  I've 
> been googling
> now for awhile and haven't really found anything (maybe my 
> search criteria
> is wrong).  Does anyone have any pointers on the best way to do this?
> 
> Thanks!
> 
> Jerry Jalenak
> Development Manager, Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
> 
> [EMAIL PROTECTED]
> 
> 
> This transmission (and any information attached to it) may be 
> confidential
> and
> is intended solely for the use of the individual or entity to 
> which it is
> addressed. If you are not the intended recipient or the 
> person responsible
> for
> delivering the transmission to the intended recipient, be 
> advised that you
> have received this transmission in error and that any use, 
> dissemination,
> forwarding, printing, or copying of this information is 
> strictly prohibited.
> If you have received this transmission in error, please 
> immediately notify
> LabOne at the following email address: 
> [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

This transmission (and any information attached to it) may be confidential
and
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible
for
delivering the transmission to the intended recipient, be advised that you
have received this transmission in error and that any use, dissemination,
forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify
LabOne at the following email address: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to