Input File Length in Internet Explorer
I want to get the number of files selected for input file. In HTML, I have:
<input id="photoFile" type="file" name="pictures" multiple="multiple"/>
Im using JQuery and I have:
$('#photoFile').get(0).files.length;
But I found out this is not a solution for Internet Explorer. It works in Chrome, Firefox, Safari and Opera. How to make it work also in IE 8+?
即使IE9不支持HTML5 File API,因此它会为文件属性返回未定义的值。
它是File API,它在IE 8和IE 9中不受支持。
由于IE9不支持File API,因此您可以在Github上尝试使用此Polyfill。
链接地址: http://www.djcxy.com/p/42004.html