php HTML5 输入类型文件的多个属性在 IE 中不起作用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5987936/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
HTML5 input type file's multiple attribute not working in IE?
提问by learner
I want to create a multi file uploder using HTML5 and PHP5. I don't want to use any flash player for support. Flash uploader will not support in iphone. I created the form like this
我想使用 HTML5 和 PHP5 创建一个多文件上传器。我不想使用任何 Flash 播放器来支持。iphone 不支持 Flash 上传器。我创建了这样的表格
<form name="uploader" method="post" action="" enctype="multipart/form-data">
<input type="file" name="images[]" id="images" multiple="multiple" />
<input type="submit" name="button" value="Submit" />
</form>
It is working with chrome, mozilla, opera, safari... but IE not supporting this.
它适用于 chrome、mozilla、opera、safari……但 IE 不支持这一点。
I tried with IE8 and IE9 both are not supporting. How can I fix this? Anybody who knows the solution please kindly help me.
我试过 IE8 和 IE9 都不支持。我怎样才能解决这个问题?任何知道解决方案的人请帮助我。
回答by Rich Bradshaw
A few things:
一些东西:
- IE doesn't support multiple file upload
- Flash is currently the way to get round that, or just to drop to single uploads in IE
- The iPad doesn't support Flash, but also doesn't support file uploads
- The usage of IE is much higher than iOS
- IE 不支持多文件上传
- Flash 目前是解决这个问题的方法,或者只是在 IE 中删除单个上传
- iPad不支持Flash,也不支持文件上传
- IE的使用率远高于iOS
So, the logical conclusion is either:
所以,合乎逻辑的结论是:
Use multiple uploads in new browsers, and single in older ones – IE users won't notice, as they have never been able to upload multiple files anyway!
Use Flash as a fallback in older browsers
在新浏览器中使用多次上传,在旧浏览器中使用一次上传 - IE 用户不会注意到,因为他们无论如何都无法上传多个文件!
在旧浏览器中使用 Flash 作为后备
(Update: iOS6 now does allow file upload, including multiple uploads)
(更新:iOS6 现在允许文件上传,包括多次上传)
回答by Craig White
IE8 does not support HTML5. Perhaps IE9 is running in compatibility mode? Press F12 to bring up the developer tools and in the top menu you can change the settings in what mode it is in.
IE8 不支持 HTML5。也许 IE9 在兼容模式下运行?按 F12 调出开发人员工具,在顶部菜单中,您可以更改其所处模式的设置。
Maybe it is a solution to use a Java or Flash based system for multiple uploads. Also, these will also usually support drag and drop of files.
也许这是使用基于 Java 或 Flash 的系统进行多次上传的解决方案。此外,这些通常也支持拖放文件。
回答by TNi
IE9 does not support multiple file uploads or the File API, according to this source. Here is another threadon SO asking the same question with the same answer. Like Craig says, your best bet for now is to use Flash as a replacement in IE and older browsers; such a solution is employed by Dojo 1.6.
根据此来源,IE9 不支持多个文件上传或文件 API 。这是关于 SO 的另一个线程,用相同的答案提出相同的问题。就像 Craig 说的,目前最好的办法是在 IE 和旧浏览器中使用 Flash 作为替代品;Dojo 1.6采用了这样的解决方案。