Two Laptop Bag
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
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Multiple File Upload" Watch "Multiple File Upload" New topic

Multiple File Upload

santhi deeksha

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

Joined: Jan 10, 2002
Posts: 63862

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] [About Bear] [Books by Bear]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

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
I agree. Here's the link:
subject: Multiple File Upload
It's not a secret anymore!