FileUpload in Chrome gives some fake path value

I try to upload a file in Chrome, then it gives some fakepath.for value for example. It gives the file name, for example, "C: \ fakepath \ Hi.txt". Could you explain to me why this is happening? In other browsers it works fine.

+5
source share
2 answers

Chrome shows it for security reasons.

Also check out this meta stackoverflow link

+3
source

You cannot do this. For security reasons, you cannot get the actual physical path to the downloaded file.

 document.getElementById("yourFileInput").files[0].fileName;

this will give you the file name from the loaded path.

0
source

All Articles