Reputation: 537
I am trying to use FileReader(0.10.3) read in an jpg file. For it errors out with message: "cannot read as File: {}" when I call readAsDataURL. I looked at the error that points to inside the method, it seems to be looking for properties path, stream and buffer to exist on the file object, which they are undefined for my image. The image was taken from a phone camera.
// let reader = new Filereader();
// reader.addEventListener("load", function() {
// image['previewUrl'] = reader.result;
// }, false);
// reader.readAsDataURL(file);
Please help! Thank you!
Upvotes: 0
Views: 1592
Reputation: 594
This worked for me webpack - 'FileReader' is not defined
instead of
var reader = new FileReader()
use
var reader = new window.FileReader()
Upvotes: 1