Reputation: 535
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".
Upvotes: 1
Views: 459
Reputation: 36
No it's not, you can't access the filesystem from withhin javascript. Why would you like to do that?
Upvotes: 1
Reputation: 943142
The file should be downloaded somewhere locally.
It could be held only in RAM.
Is it possible to get its path in JavaScript?
No. Even if the browser has cached it to disk, JavaScript doesn't have access to any information about that cache.
Upvotes: 1
Reputation: 61793
Short answer: No.
JavaScript cannot access a users file system under any circumstances (this would be a security nightmare).
Upvotes: 2