我已经创建了一个文件上传函数,它在Chrome,firefox,ie10和ie11中很好用。jquery的数据在IE9中返回undefined
但在ie9中,我无法获取上传的文件。那获取文件
代码:
var files = $('.browseOption input[type=file]').data('files');
文件总是不确定的某些原因。 我也注意到,对于上传的URL是C:\fakepath\test.csv
为了解决这个问题,我改变了IE设置为“包含本地目录路径时,将文件上传到服务器”
但脚本问题仍然
HTML
<div class="browseOption"> <span><input value="Bläddra" type="button" class="button" /></span>
<input type="text" class="uploadFile" placeholder="Välj en bildfil" readonly/>
<input type="file" name="Person.UploadedImg" class="upload hidden" />
</div>
我试着不要在这里显示不必要的代码,但如果你需要更多或如果我不清楚只问。
谢谢!
你用过哪些jquery库? –