aspose file tools*
The moose likes JSP and the fly likes multiple fileupload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "multiple fileupload" Watch "multiple fileupload" New topic
Author

multiple fileupload

sarada devi
Greenhorn

Joined: Jan 04, 2006
Posts: 7
Hi,

can you please tell me How to upload more than one file at a time in jsp using jsp:usebean?

I mean to say that i want to select more than on file at a time and when i click upload button, the selected files have to upload.

Tahnks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

You don't use the <jsp:useBean> action for file upload.

For uploading files you need to employ a file input element in a multi-part form, and a servlet that knows how to deal with the resulting multi-part request.

Frequently an existing 3rd party library is used to accomplish this. See the JSP FAQ for more info.

The file input element only allows you to select and upload one file at a time. There is nothing you can do about this in a JSP or otherwise.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Bear Bibeault:
See the JSP FAQ for more info.


Here you are.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I'm using Yahoo Mail, where you can specify more than one file at a time.
Is it different from file uploading ?


[My Blog]
All roads lead to JavaRanch
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

Yahoo Mail uses one file input element for each attachment. You cannot select more than one file at a time. The multi-part request can handle multiple files in the request, but there is no way to force the file input element to allow multiple selections. You need to resort to the type of thing that the attachment page of Yahoo Mail does.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Thanks.

There is one page, with File1, File2, File3, File4, File5.
We can set each file, and click the Attach button once.
And send the mail once.
This is probably a solution to what the Sarada wants to do.
He wants to upload more than one file at a time, and your post sounded like it is impossible to do.

I forgot.
I'm talking about Yahoo Japan, where you can attach 5 files once.

[ January 22, 2006: Message edited by: Satou kurinosuke ]
[ January 22, 2006: Message edited by: Satou kurinosuke ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Satou kurinosuke:
He wants to upload more than one file at a time, and your post sounded like it is impossible to do.


Yes, if you want to do that with a single form field.


I forgot.
I'm talking about Yahoo Japan, where you can attach 5 files once.


Yahoo used to do that. Its not particularly Yahoo Japan.

- Yahoo mail file attachment used to upload multiple files at once
- Yahoo Geocities Fiel Manager used to upload more than one file at once
- Yahoo Briefcase does the same
[ January 22, 2006: Message edited by: Adeel Ansari ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Yes, if you want to do that with a single form field

I've seen nowhere Sarada talking about a single field.
Where is this assumption coming from ?
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Satou kurinosuke:
I've seen nowhere Sarada talking about a single field.
Where is this assumption coming from ?


Otherwise, its possible. As you know Yahoo is doing that.

And by "single form field", I meant "single HTML file input element". Bear discussed the same thing.

Any confusions?
[ January 23, 2006: Message edited by: Adeel Ansari ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Bear discussed the same same thing


I know, and that's where my problem is.
Why are you talking about a 'single element' ?
The author of this thread did not mention that.

The discussion is going a completly different way:
Q. Can I do this ?
A. No you can't with a single element
Did I say a single element ?

Q. Can I ride this rollercoaster ?
A. No you can't under 1.2m bodysize
Did I say I was short ?
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Satou kurinosuke:
I know, and that's where my problem is.
Why are you talking about a 'single element' ?
The author of this thread did not mention that.

The discussion is going a completly different way:
Q. Can I do this ?
A. No you can't with a single element
Did I say a single element ?

Q. Can I ride this rollercoaster ?
A. No you can't under 1.2m bodysize
Did I say I was short ?


I would like take the opportunity to remind you the only one rule of this saloon. It is "be nice". Its my courtesy that I am not considering your response as offense.

Please dont mind I was just trying to steer you in a right direction.

Well, if we dont care about single field or multiple fields then you were wrong in saying that, its impossible to upload multiple files. I just tried to support your assumption. But now you are not really happy with that. Then I must say that, its possible to upload multiple files at once. And this time I am not mentioning the case.

Thanks.
[ January 23, 2006: Message edited by: Adeel Ansari ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Bear Bibeault:
Yahoo Mail uses one file input element for each attachment. You cannot select more than one file at a time. The multi-part request can handle multiple files in the request, but there is no way to force the file input element to allow multiple selections.


Here Bear tried to explain you the same thing that Yahoo uses multiple elements otherwise it can't be done with a single file input element.

Please read the post carefully prior to respond that post. However, if you didn't really get the explaination, please ask again may be someone like me would clear your doubts.

And please dont shoot the messenger.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I apologize and do not meant to be rude. Sorry for my poor english
I wanted to confirm that we can upload multiple files.
Of course, as you said, we can't with a single input field.

Please accept my apologize.

I thought that the point of the discussion was going slightly out of subject, and I wanted to bring it back on track. No shooting.
[ January 23, 2006: Message edited by: Satou kurinosuke ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Satou kurinosuke:
Sorry for my poor english


You need not. We dont really care about english here.

Originally posted by Satou kurinosuke:
Please accept my apologize.


Again you dont need to. Sometimes it turns other way round. No worries. You are always welcome.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Thank you I'll try to be careful the way I write. Reading my posts again, I realize that it sounded harsh.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: multiple fileupload