How to get full path from html input file ? Like this C:/user/desktop/something.png But is's coming something.png or C:/fakepatch/something.png
Asked
Active
Viewed 669 times
0
-
share some of your code will help us understand – ANIK ISLAM SHOJIB Sep 23 '19 at 09:27
-
It depends on the server and operating system. – some Sep 23 '19 at 09:27
-
Possible duplicate of [How to resolve the C:\fakepath?](https://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepath) – ArunKumar M N Sep 23 '19 at 09:28
-
do you mean a file that is selected using ``? then, it's none of your concern – Jaromanda X Sep 23 '19 at 09:33
1 Answers
1
You cannot. This is a security measure implemented by the browser.
See https://www.w3.org/TR/html52/sec-forms.html#example-4aa6dac8
For historical reasons, the value IDL attribute prefixes the file name with the string "C:\fakepath\". Some legacy user agents actually included the full path (which was a security vulnerability).
If you were able to see the full path, you might be able to compromise the user's privacy. For example, it might leak their user name, full name, type of computer they're on, etc.

Terence Eden
- 14,034
- 3
- 48
- 89