档案API无法在IE9中运作 [英] The File API isn't working in IE9
本文介绍了档案API无法在IE9中运作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用jQuery从表单的输入字段中获取文件大小和文件类型.我以为它可以正常工作,但是显然不能在IE 9中使用.
I'm trying to get the file size and file type from an input field from my form using jQuery. I thought it was working however apparently not in IE 9. Any insight would be greatly appreciated
var my_field = this.files[0];
var myInteger = parseInt(my_field.size);
var myType = my_field.type;
推荐答案
我正在尝试从输入字段中获取文件大小和文件类型...
Im trying to get the file size and file type from an input field...
这需要文件API ,其中(并且请注意,size
已经是 个数字(在支持File API的浏览器中,无需parseInt
.)
(And note that size
is already a number [on browsers that support the File API], no need to parseInt
it.)
这篇关于档案API无法在IE9中运作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文