Page 1 of 1

Prevent logos and images from web page

Posted: Thu Mar 09, 2006 5:43 am
by yasin
Hi

how a logos or images of a website can be prevented from downloading.Please tell me methods which i have to follow.

Posted: Thu Mar 09, 2006 6:09 am
by mickd
I do not think that is possible. No matter what, the user will have to download the output onto their computer to view it, including images.

Posted: Thu Mar 09, 2006 7:27 am
by Chris Corbyn
mickd wrote:I do not think that is possible. No matter what, the user will have to download the output onto their computer to view it, including images.
Actually, you can prevent them from being linked to or dispayed on other webistes by using hotlink protection. I think it's available as module under apache but if you have CPanel access you should be able to set that up from there.

You can't stop people visiting your site and taking them from there though.... if you want to display them on a webpage they will be downloaded in any case so that the browser can display them.

Posted: Thu Mar 09, 2006 8:07 am
by Grim...
Not cheap, but it does the job - stops everything except a screen capture: http://www.artistscope.com/secure_image/

Posted: Thu Mar 09, 2006 8:14 am
by jayshields
Couldn't you use PHP with header() to output the image?

Just put all your images in a directory tree like 'you/wont/guess/this/' and then have MySQL store the filename and a random id. Have the script like image.php?random_id=whatever and regenerate a new ID for it each time.

That's what I'm going to use in my upcoming project to prevent hotlinking, seems OK to me?

Posted: Thu Mar 09, 2006 8:26 am
by guided1
hot linking? what's that?

Is that where other people link directly to your images?

if so... you can fix that with a .htaccess (assuming apache ofcourse...)

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?your-url\.com/ [nc]
RewriteRule .*\.(gif|jpg|png)$ http://your-url.com/img/porn-pic.gif [nc]

this will only allow requests from your domain to view images...

Posted: Thu Mar 09, 2006 8:36 am
by Chris Corbyn
guided1 wrote:hot linking? what's that?

Is that where other people link directly to your images?

if so... you can fix that with a .htaccess (assuming apache ofcourse...)

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?your-url\.com/ [nc]
RewriteRule .*\.(gif|jpg|png)$ http://your-url.com/img/porn-pic.gif [nc]

this will only allow requests from your domain to view images...
Yeah that's what I was referring to ;) Never actually thought it was as simple as a rewrite but it makes perfect sense.

Posted: Thu Mar 09, 2006 8:37 am
by Chris Corbyn
jayshields wrote:Couldn't you use PHP with header() to output the image?

Just put all your images in a directory tree like 'you/wont/guess/this/' and then have MySQL store the filename and a random id. Have the script like image.php?random_id=whatever and regenerate a new ID for it each time.

That's what I'm going to use in my upcoming project to prevent hotlinking, seems OK to me?
Wha? You can still download them... the only difference is the filename used to access them. It would be very easily by-passed.

Posted: Thu Mar 09, 2006 8:46 am
by jayshields
Sorry, I missed the point slightly, you can always download the image, because it's been sent to the browser, I can't imagine how that thing Grim... posted would work, even though print screen would get around it anyway...

I just posted my idea to stop hot linking, didn't realise it was so easy in Apache, but you need mod_rewrite enabled don't you? Since I'm on a shared host I doubt it could be enabled if it's off...

Posted: Thu Mar 09, 2006 8:56 am
by Chris Corbyn
jayshields wrote:Sorry, I missed the point slightly, you can always download the image, because it's been sent to the browser, I can't imagine how that thing Grim... posted would work, even though print screen would get around it anyway...

I just posted my idea to stop hot linking, didn't realise it was so easy in Apache, but you need mod_rewrite enabled don't you? Since I'm on a shared host I doubt it could be enabled if it's off...
I think the thing Grim... posted was an applet of some sort... it's not actually an image, it's rendered using some sort of secure plugin rather than the browser...