Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes Downloading multiple files in one request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Downloading multiple files in one request" Watch "Downloading multiple files in one request" New topic
Author

Downloading multiple files in one request

Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi All,

I have a jsp where it displays a list of files to the user in a form of List Box. User will click multiple entries in the List Box where each entry corresponds to one File.

All my files are save into the database as BLOB files. Upon extracting the list of files that the user wants to download, I will look up at my database and get all the files then convert the BLOB files to proper format then forward it to the user.

But I am wondering if its possible in this way? I have looked in the net and found some good examples of file download but it contains only one file. Need some advice on this one or should i just abandon my thought.

Is it possible to download multiple files all in one request and save it all in the local directory of the users.? Thanks


Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18902
    
    8

The reason you can only find examples that download one file is: you can only download one file. Nothing to do with Struts, that's just how HTTP works.

You could zip all the user's selections into a single zip archive and download that, but the user might not thank you for that.
Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi Paul,

I did thought of zipping the file before downloading it to the client but as you have said, user might not thank me for that. Thanks for the help.
 
wood burning stoves
 
subject: Downloading multiple files in one request