Search code examples
javascriptbrowser-cache

How can I retrieve the local path of an image after it being loaded from the web?


Is it possible to get the local path of an image? Let say I have the following piece of code:

<img src="http://myserver/myimg.png" id="myimg"/>

The file should be downloaded somewhere locally. Is it possible to get its path in JavaScript? A string that would look like "C:\Users\blabla".


Solution

  • Short answer: No.

    JavaScript cannot access a users file system under any circumstances (this would be a security nightmare).