ValRus
ValRus

Reputation: 119

is there a way to hide source of image loaded in html img element or to cypher it?

I want to load image into <img src"..."/> and hide it's original source. Or - to cypher. Is there any possible solutions?

UPDATE: I want to do it, because I do not want that user could find original source of image and get to it.

May be there could be the way to save it to temporary location, rename it with random letters and then use the image?

Upvotes: 0

Views: 295

Answers (3)

Rob Falken
Rob Falken

Reputation: 2297

Now that the question is clarified, my best guess would be to download the image to your server and then use some kind of hotlink protection to prevent users from access it directly. See http://www.htaccesstools.com/hotlink-protection/ for more information. You might need another solution depending on your technology (server/programming language)

Upvotes: 2

Fisch
Fisch

Reputation: 3815

One thing you can try is to use a canvas element, then load your image into the canvas via javascript. Then get the datauri of the canvas and set that as the value of your img src.

Upvotes: 1

Niels B.
Niels B.

Reputation: 6310

No. Any img element results in an HTTP request for that image resource. This is easily trackable in most browsers.

Upvotes: 0

Related Questions