在Internet Explorer中输入文件长度 [英] Input File Length in Internet Explorer

查看:104
本文介绍了在Internet Explorer中输入文件长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得为输入文件选择的文件数量。在HTML中,我有:

 < input id =photoFiletype =filename =picturesmultiple = 多重/> 

使用JQuery我有:

  $( '#photoFile')得到(0).files.length。 

但我发现这不是Internet Explorer的解决方案。它适用于Chrome,Firefox,Safari和Opera。即使IE9不支持HTML5 File API,因此它会返回未定义的值。如何使它在IE 8 +中也能正常工作?解析方案

为文件属性。


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+?

解决方案

even IE9 does not support HTML5 File API and therefore it returns undefined value for files property.

这篇关于在Internet Explorer中输入文件长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆