admin管理员组文章数量:1414946
I have this loadfile function that loads an image after uploading.. I want to convert to get its URL path... but im receiving an error "URL.createObjectURL is not a function" but when i console the e.target.files[0], I can view the file in console.. can any one help me?
loadFile: function(e){
var output = document.getElementById('output');
output.src = URL.createObjectURL(e.target.files[0]);
}
I have this loadfile function that loads an image after uploading.. I want to convert to get its URL path... but im receiving an error "URL.createObjectURL is not a function" but when i console the e.target.files[0], I can view the file in console.. can any one help me?
loadFile: function(e){
var output = document.getElementById('output');
output.src = URL.createObjectURL(e.target.files[0]);
}
Share
Improve this question
asked May 13, 2016 at 10:23
trebtreb
5481 gold badge7 silver badges16 bronze badges
1
- Do you have any database storages like Firebase Storage? – Ragul CS Commented Mar 14, 2020 at 1:06
1 Answer
Reset to default 2This most definitely is unrelated to react. The reason you're likely experiencing this is the createObjectURL is still a part of a working draft and has not yet been finalized, and as such you won't have much browser patibility. See the below patibility chart to see if your browser supports the feature:
https://developer.mozilla/en-US/docs/Web/API/URL/createObjectURL#Browser_patibility
本文标签: javascriptReactjs URLcreateObjectURL is not a functionStack Overflow
版权声明:本文标题:javascript - Reactjs URL.createObjectURL is not a function - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745190935a2646907.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论