IE: input type=“file” multiple

怎甘沉沦 提交于 2019-12-18 07:39:13

问题


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?


回答1:


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




回答2:


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.




回答3:


You may use button that create additional inputs in IE.
It will work same as multiple input in other browsers(for your server).

Sure, users will should select every file one by one, but they use IE




回答4:


I got it fixed by adding below metadata at the top of page after "Title" tag.

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

"IE=Edge" loads the latest version of IE version.



来源:https://stackoverflow.com/questions/7085171/ie-input-type-file-multiple

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!