I would like to store the local path of an uploaded image in a variable. I created a FileReader
in order to get information on the file. Here is my code:
var reader = new FileReader();
reader.readAsDataURL(event.target.files[0]); // read file as data url
console.log(event.target.files[0]);
This is an example output:
lastModified: 1536526410000
lastModifiedDate: Sun Sep 09 2018 16:53:30 GMT-0400 (GMT-04:00) {}
name: "slider-2.jpg"
size: 627442
type: "image/jpeg"
webkitRelativePath: ""
__proto__: File
I would like to get the local path of the computer, since this is angular, when I tried window.location.pathname
but it just returns the path from localhost being localhost:4200/register
How can I get my full path?