0

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

1 Answers1

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
  • 12,942
  • 3
  • 40
  • 79