can i make file dialog in input type file in html to be multi select?
Asked Answered
I

3

6

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.

Inure answered 12/8, 2010 at 17:54 Comment(0)
M
1

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

Maliamalice answered 12/8, 2010 at 18:5 Comment(2)
I looked at Gmail and i must say WOW i was looking for that!! but i dont know how to implement it.Inure
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 swfupload.org might get you started. I'm sure the SO community could help if you try an implementation and get stuck.Maliamalice
R
7

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>
Reflation answered 12/8, 2010 at 18:1 Comment(3)
Don't suggest something we can not use today :) We are far away from HTML5, see this: #2261638 and caniuse.comFolly
That very much depends on both target audience and application. And it is good to know that this will be in HTML5.Reflation
However, this is a way to use HTML 5 in IE 6, 7 and 8. davidwalsh.name/chrome-frameBallard
F
1

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:

Folly answered 12/8, 2010 at 17:57 Comment(6)
can you tell me why? what prevents a multiselect?Inure
@sushil bharwani: This is W3C specification, browsers won't allow you to select more than one file for a single input file. More info: w3.org/TR/html401/interact/forms.htmFolly
@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.Inure
@sushil bharwani: Nope, not possible, browser won't do that still :( If you want to use flash, see the answer of @Maliamalice though.Folly
I can use flash. But the answer does not suggest a direction as how to implementInure
@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.Folly
M
1

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

Maliamalice answered 12/8, 2010 at 18:5 Comment(2)
I looked at Gmail and i must say WOW i was looking for that!! but i dont know how to implement it.Inure
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 swfupload.org might get you started. I'm sure the SO community could help if you try an implementation and get stuck.Maliamalice

© 2022 - 2024 — McMap. All rights reserved.