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]);
}
This 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 compatibility. See the below compatibility chart to see if your browser supports the feature:
https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL#Browser_compatibility
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With