*
The moose likes Servlets and the fly likes What's a correct way to select multiple files for download. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "What Watch "What New topic
Author

What's a correct way to select multiple files for download.

Vincent Oh
Ranch Hand

Joined: Jan 02, 2012
Posts: 33
I have a table with checkboxes which indicate which files to download.
If it's a single tick, the file will be downloaded directly, if multiple ticks, it will be zipped and sent by the server.

Problem: How should I send user's choice (files which are ticked) to the servlet? I was thinking of concating the fileIDs into a String and sent it over via GET.

Is there a better way to do this?

Thanks.
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1753
    
    7

If you give all the checkbox input elements the same name, you can retrieve the values of the ones the user checked using the getParameterValues() method of ServletRequest.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Vincent Oh
Ranch Hand

Joined: Jan 02, 2012
Posts: 33
Icic. Thanks alot!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What's a correct way to select multiple files for download.
 
Similar Threads
Multiple file download
Multiple requests to download files using Applets
download multiple files.
Multiple requests to download files using JavaScript
SOAP with attachments, 3 questions