Read / download file using local absolute path

I have one file that is stored D:/home/abc.pdflocally. I need to read this file usingAngularJs

var path="D:/home/abc.pdf";
var doc = document.createElement("a");
doc.href = path;
doc.download = path;
doc.click();
window.URL.revokeObjectURL(path);

I can not download this file. Error when using, as Error with network error enter image description here

+6
source share
1 answer

This is not possible because local files are protected. Alternatively, you could manage the hard drive as you wanted by simply running a local HTML page.

So: if you want to get the file from the computer’s hard drive, you should use the field <input>and ask the user to download the file using it.

+1
source

All Articles