Preventing downloading of images.

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
SonicSnoop
Forum Newbie
Posts: 4
Joined: Wed Sep 18, 2002 2:38 pm
Location: Triangle, VA
Contact:

Preventing downloading of images.

Post by SonicSnoop »

Is it possible to protect images so they cant be downloaded, only viewed on the site? somehow disable the ability to rightclick and save as.. now currently I am using the scripts found HERE to store the images in a database and call them up from a script.. but they can still be saved just need to change the extension from phtml to jpg or what ever.. Any help you can offer id be greatful! Thank you!..
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

One thing you can do is to put a transparent image in front of the actual image so that when user try to save the image they will save the transparent image, but if the user goes and see the code they can download it from the URL found there. ONly thing to stop that is I think editing httpd.conf on Apache.
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

Post by Coco »

well the first thing that you can do is put in a 'no right click' JS
but you can get past that anyhow by holding left and then clicking right :)

if you then put it in a frames page then the main menu view source just gives your frames and not the actual page source

check out http://www.javafile.com/
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Use this code to stop right click on the page

Code: Select all

<body oncontextmenu="return false">
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Unfortunately the only surefire way to prevent images from being downloaded is to not put them on your website in the first place. Disabling right-click just irritates people who couldn't be bothered to steal your images but who are trying to use it for other reasons and javascript can be easily turned off anyway.

Article you should probably read

Mac
jamesf4218
Forum Newbie
Posts: 9
Joined: Mon Sep 23, 2002 10:36 am

Post by jamesf4218 »

You can't.

If I want your pictures, I'll just do a print screen and save them out that way.
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

when i view pictures on a site, my browser has already downloaded the image and stored it into cache. if i wan't to right-click>save that pic all i am really doing is copying the image from cache to a directory of my choice. all these right-click scripts and transparent layers are just deterents from a simple way of doing a file copy manuver. personally i think it is a sign of un-professionalism to use right-click scripts. i do however understand the want and sometimes the need for protecting images from being saved from a web page. i don't want to ramble on in an attempt to give a solution but i hope you understand what you are combating now.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

if there's no other way a simple 'save as' on a page nullifies all affords of protecting images.
You may embed (nearly) invisible watermarks in your images. There are good tools available. But you have to search for 'stolen' pictures - good luck ;)
Post Reply