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.
Chrome shows it for security reasons.
Also check out this meta stackoverflow link
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.