views:

158

answers:

3

I want to implement a multi file upload I was thinking if its possible to have a browse button open a file dialog which may allow me to select more than one file and once i select them these files can upload. I am doing this on a website and using php jQuery etc.

By looking at the answers i feel that multi-select is not possible. So i am updating my question to this : Can i select a zip file and get a set of file objects inside zip file and then work on individual file objects.

+1  A: 

Nope, that's not possible, you can specify one file at a time for a single file type. On the other hand, you might want to have a look at:

Sarfraz
can you tell me why? what prevents a multiselect?
sushil bharwani
@sushil bharwani: This is W3C specification, browsers won't allow you to select more than one file for a single input file. More info: http://www.w3.org/TR/html401/interact/forms.htm
Sarfraz
@sarfraz sorry if i am asking too much!! can we do it by some custom dll or something.Like a program that runs just for me.
sushil bharwani
@sushil bharwani: Nope, not possible, browser won't do that still :( If you want to use flash, see the answer of @KatieK though.
Sarfraz
I can use flash. But the answer does not suggest a direction as how to implement
sushil bharwani
@sushil bharwani: Yes that's unfortunate answer is that way. But note that if flash is player/plugin is not installed on user's browser, it won't work.
Sarfraz
A: 

In some of the more up-to-date browsers that support HTML5 (i.e. Firefox, Chrome, Safari), the multiple attribute will work:

<label>Select files: <input name="files" type="file" multiple></label>
You
Don't suggest something we can not use today :) We are far away from HTML5, see this: http://stackoverflow.com/questions/2261138/when-should-i-go-for-html5-css3 and http://caniuse.com/
Sarfraz
That very much depends on both target audience and application. And it *is* good to know that this will be in HTML5.
You
+1  A: 

Gmail allows selecting multiple files as attachments by using a Flash control just for the upload.

KatieK
I looked at Gmail and i must say WOW i was looking for that!! but i dont know how to implement it.
sushil bharwani
Yeah, it's a really nice implementation; very subtle. So that's why I thought I'd mention it as an option. I haven't tried this myself, but http://swfupload.org/ might get you started. I'm sure the SO community could help if you try an implementation and get stuck.
KatieK