GeeCON Prague 2014*
The moose likes Servlets and the fly likes Can I upload multiple files at one time? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Can I upload multiple files at one time?" Watch "Can I upload multiple files at one time?" New topic
Author

Can I upload multiple files at one time?

Stephen Wei
Ranch Hand

Joined: Oct 09, 2001
Posts: 73
What I want to do is:
User selects multiple image files in one file control box, then submit all those files to the server by click "Submit".
Can I do this? I think the "Input type= "File"" control only allows user to select one file.
How can I do multiple uploading? I do not want to use one control box for one file though. Also, if on the client side I can do this, how about the Server side package? which package can handle multiple files in one NAME?
Thanks!
------------------
Sun Certified Programmer for Java Platform


Sun Certified Programmer for Java Platform
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

This is like asking "I want 5 people to sit on 4 chairs, but no one can share a chair".

Client side: The file upload control allows a *single* file to be entered. If you want more than one file upload on a form, use more than one file upload control.

Server side: Since it's a basically impossible (for now) task to stuff two files into a single logical 'file upload' segment on the multipart request, there are no packages that would understand your POST.
 
jQuery in Action, 2nd edition
 
subject: Can I upload multiple files at one time?