Javascript file upload

做~自己de王妃 提交于 2019-12-05 18:58:44

问题


In most browsers, an input type="file" has the following files property:

document.getElementById("my-input").files

This can be used to detect a file is uploaded, and get the file. However, it looks like the files attribute doesn't exist in IE9.

Added:

In jQuery, you can do...

$("#my-input").val() to read the file name. What about getting the files contents?


回答1:


Use jQuery and this plugin.



来源:https://stackoverflow.com/questions/6191792/javascript-file-upload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!