admin管理员组文章数量:1394217
I saw somewhere someone talking about FileReader in JavaScript. What is it? What could be its use cases? Isn't it posing security problems, as it gives JavaScript access to disk?
var temp = new FileReader();
temp.onload = function(e){
// Where did it load anything?
};
I saw somewhere someone talking about FileReader in JavaScript. What is it? What could be its use cases? Isn't it posing security problems, as it gives JavaScript access to disk?
var temp = new FileReader();
temp.onload = function(e){
// Where did it load anything?
};
Share
Improve this question
asked Jul 7, 2011 at 5:18
Saeed NeamatiSaeed Neamati
35.9k42 gold badges139 silver badges192 bronze badges
1
- now where did you see this? It could be javascript that is not running in a browser, you know.. – jrharshath Commented Jul 7, 2011 at 5:23
2 Answers
Reset to default 5This is an HTML5 feature. Check out the documentation here:
HTML5 FileReader
It's important to note that not all (IE) browser support this functionality.
FileReader on MDC. It's related to the HTML5 Blob and FileApi's. I'm pretty certain that a website can't just read random files, it can only read blobs that are basically user controlled (either from the site, or accessed via file APIs with consent)
本文标签: fileWhat is JavaScript FileReader and where it could be usedStack Overflow
版权声明:本文标题:file - What is JavaScript FileReader and where it could be used? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744676701a2619155.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论