1

How can I convert the local file URL to the blob before I pass it to the FileReader. Here, I'm trying to convert the local file in the assets to convert it to blob and pass it to the file reader. Is there any way to convert it into typescript/ javascript?

let fr = new FileReader();
let somePath: any = 'file:///src/assets/someData.png';
fr.readAsText(somePath);
NoobDeveloper
  • 61
  • 1
  • 4

1 Answers1

2

It's linked to this question How to read a local text file?

Basically your browser can not read a file on the local file system if it's not hosted by any WebServer, due to security policies.