This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Multiple File Upload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Multiple File Upload" Watch "Multiple File Upload" New topic
Author

Multiple File Upload

santhi deeksha
Greenhorn

Joined: Apr 02, 2010
Posts: 8
Hi, I am writing a JSP that is able to upload multiple files at a time (with a single File element). My idea is to create a table and add a row to it when a file is selected. And what I would like to do is to pass these values to an array and submit to the server. Here's what I've written so far.

I thought I could create an array with selected checkboxes and submit the array but I realize that I cannot return it to the JSP (or can I?). Can anyone suggest how to proceed further from here? I am open to an entirely different way of doing this if it is possible. The only constraint is I cannot limit the user to a max number of files and have to use a single file element.

Thanks in advance for your help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60767
    
  65

Please take the time to choose the correct forum for your posts. This forum is for questions on JSP. For more information, please read this.

This post has been moved to a more appropriate forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Hi, I am writing a JSP that is able to upload multiple files at a time (with a single File element).


No, you're not. Because it won't work. Each file needs it's own file input in order for the server to actually get it. Do a search on google for multiple file uploads. You'll find loads of ways of doing this. Some using flash, some using the iframe trick. But it's not going to work the way you are attempting it right now.


GenRocket - Experts at Building Test Data
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Multiple File Upload
 
Similar Threads
adding and deleting a row in html
Multiple Select box Problem
Problem in onclick radio and dynamically populated table
fixed header, problem with alignment, must support all browsers
Submit popup