I have one file which is stored at D:/home/abc.pdf
locally.
I have to read this file using AngularJs
var path="D:/home/abc.pdf";
var doc = document.createElement("a");
doc.href = path;
doc.download = path;
doc.click();
window.URL.revokeObjectURL(path);
I am not able to download this file.Giving error like Failed-Network error
That is impossible since local files are protected. Else you would be able to manipulate the hard drive as you wanted just by running a local HTML page.
So : if you want to get a file from the computer's hard drive, you have to use an <input>
field and ask the user to upload the file using it.
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