Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE: input type="file" multiple

How come IE 9 does not support input type="file" multiple like other browsers do?

<form action="#" method="post" enctype="multipart/form-data">
  <input type="file" multiple name="uploads[]" />
  <input type="submit"/>
</form>

How can I make it work on IE?

like image 912
Run Avatar asked Aug 16 '11 21:08

Run


People also ask

How do you make an input type file multiple?

Tip: For <input type="file"> : To select multiple files, hold down the CTRL or SHIFT key while selecting. Tip: For <input type="email"> : Separate each email with a comma, like: [email protected], [email protected], [email protected] in the email field.

How do I limit maximum items in multiple inputs?

For limiting maximum items on multiple inputs, use JavaScript. Through this, limit the number of files to be uploaded. For example, let's say only 2 files to be uploaded at once. You can try to run the following code to learn how to use multiple attributes in HTML.


2 Answers

Uploading multiple files is a specific part of HTML5 that none of the Internet Explorers support.

like image 192
vaxt Avatar answered Sep 19 '22 02:09

vaxt


IE should support multiple according to this doc:

http://msdn.microsoft.com/en-us/library/ie/hh772307(v=vs.85).aspx

But even so, their own example does not work with IE9 for me..

<input type="file" multiple="multiple" onchange="for (var i = 0; i < this.files.length; i++) { document.write(this.files[i].name ) };" />

When the onchange event fires, the files property doesn't appear to exist for the HTMLInputElement in IE, whereas in Chrome it does.

Update: this doc apparently doesn't apply to IE9. IE 10 is said to support the File API. Let's hope it will be released soon.

like image 30
Mattijs Avatar answered Sep 21 '22 02:09

Mattijs