0

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?

mendy
  • 191
  • 1
  • 12
  • 2
    You can't do that. – SLaks Feb 18 '19 at 21:49
  • Possible duplicate of [How to get full path of selected file on change of using javascript, jquery-ajax?](https://stackoverflow.com/questions/15201071/how-to-get-full-path-of-selected-file-on-change-of-input-type-file-using-jav) – Heretic Monkey Feb 18 '19 at 21:51

0 Answers0