I am getting an error in my console every time I upload an image. I'm loading it as Base64. The image uploads successfuly, and I can see the preview but error is there.
The error seems to be displayed asynchronously but I guess it is caused in this function, in the file.ReadAsDataURL method:
export function getBase64FromFile(target) {
return new Promise((resolve, reject) => {
let fileReader = new FileReader();
fileReader.onloadend = fileLoadedEvent => {
const base64 = fileLoadedEvent.target.result;
resolve(base64);
};
fileReader.onerror = () => {
reject(fileReader.error);
console.log('filereader onerror', fileReader.onerror);
fileReader.abort();
};
if (target) {
fileReader.readAsDataURL(target);
}
});
}
Looks like internaly it ends up resolving somehow but the error is annoying me.
For example for my path C:/images/autumn.jpg
I noticed that the error is:
GET c:%C3%BAkepathutumn.jpg net::ERR_UNKNOWN_URL_SCHEME
I see that the browser changes the route to C:/Fakepath/autumn.jpg for security, but , then where is the slash between Fakepath and autumn?
The error only apears in chrome, in Firefox, no error is shown.
I also tried with adding any sort of prefix as "File:///" in my target, but then It doesn't work.
Any help would be apreciated. Thanks!