my requirement is to download multiple files on click of submit button.
At present the following code sniplet downloads single files
----------------------------------------------------------------
response.setContentType("application/download");
response.setHeader("Content-disposition","attachment; filename=" + strAttachName);
response.getOutputStream().write(ByteArray());
----------------------------------------------------------------
does anybody know it?
thx
|
|
0
|
|
|
|
Reply
|
news2anil (1)
|
8/19/2003 8:57:58 AM |
|
> my requirement is to download multiple files on click of submit
> button.
> At present the following code sniplet downloads single files
> ----------------------------------------------------------------
> response.setContentType("application/download");
> response.setHeader("Content-disposition","attachment; filename=" +
> strAttachName);
> response.getOutputStream().write(ByteArray());
> ----------------------------------------------------------------
> does anybody know it?
If you mean you want the server to send the user several files after they
click submit once, then I don't think its possible.
|
|
0
|
|
|
|
Reply
|
me4 (18695)
|
8/19/2003 11:12:36 AM
|
|
biro wrote:
>
> > my requirement is to download multiple files on click of submit
> > button.
> > At present the following code sniplet downloads single files
> > ----------------------------------------------------------------
> > response.setContentType("application/download");
> > response.setHeader("Content-disposition","attachment; filename=" +
> > strAttachName);
> > response.getOutputStream().write(ByteArray());
> > ----------------------------------------------------------------
> > does anybody know it?
>
> If you mean you want the server to send the user several files after they
> click submit once, then I don't think its possible.
I'm also pretty sure that the way http works you can send only one
response; since a response corresponds to a file for a download, that
would mean you could send only one file.
For the content type you have listed, it seems that you would want to
put them all into a zip file and just send that. But, if it's supposed
to be dynamic content, you probably wouldn't want to have all possible
combinations of files stored in advance. If you want to build the zip
on the fly, see: http://www.mike-levin.com/java/zipoutputstream.html .
Otherwise, you could return an html page that lists all the individual
files as links, and let the user manually download each one (or come up
with a scheme that automates that process).
--
Steve
--
http://www.steveclaflin.com
|
|
0
|
|
|
|
Reply
|
PimentoTR6 (34)
|
8/19/2003 3:29:47 PM
|
|