No Image Download

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
phpdevuk
Forum Contributor
Posts: 220
Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:

No Image Download

Post by phpdevuk »

Hello,

I've just built a site that has product images displayed on it for a client, however I've discovered someone else has ripped the site off stealing images and other bits and bobs from the site. I want to try and stop them doing this so I've been looking at various methods of doing this.

So far I've come up with putting a bit of javascript into the page that stops right clicking (IE only unfortunately) and whacking a .htaccess file on the server to sop people linking to images etc.

These measures don't stop people going into the page in something like say firefox and just simply download images and saving them to disk.

Anyone know of any good ways to stop this?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

your out of luck you cant stop this. even with the right click a user can still view sorce and get the image if they know a lil. images are downloaded to the client so there is no way of stopping it.

your best bet is to put property of yousite.com on the picture somewhere so if it shows up on another website you can be like blah blah im sueing or somthing
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Nah Not possible

Post by neophyte »

Not possible.

I would not worry about it. Throw a water mark on all your images with your URL and get free advertising every time someone hotlinks to it and or shows it to a friend. :wink:
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

There are a few "tricks" you can use to slow-down bulk copying of the site... Store the photos outside of the webroot and have a viewphoto.php?photoid=<someid> page to pass them through.

In the viewphoto.php page you could attempt to add some "throttling" controls, ie track/detect attempts to download large number of photos in rapid succession and then error out. However you have to be careful -- if you have a gallery view you could generate a lot of false positives. Perhaps have a view-thumbnail and a view-photo page with different limits.

Its not perfect and anyone who can see the photo on the screen can still download it, so adding a watermark style thing is good. This is most jus to stop someone from using wget or similar to screen scrap your whole site.
User avatar
phpdevuk
Forum Contributor
Posts: 220
Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:

Post by phpdevuk »

yeah I'm aware of all the problems in doing it, water mark was something I thought about as all the iamges are created from gd library.

I did think about using a php script too and using the referer or something to make sure the page calling it is the products page, but essentially it still gets dumped in the browsers cache so its kinda alot of work for no gain.

Looks like I'm stumped.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you can specify the no-cache (among other) header properties.. however, it's up to the browser whether it'll honor that "deal"

generating a one time use "key" to allow downloading of the image to the browser's memory could help, although will require storing a lot of data in a database..
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Code: Select all

<body onContextMenu="return false;">
Should disable right clicking.

You could use javascript to 'encrypt' in a way the image names so when people view the source they see a bunch of jumble instead of the path to the image. I don't quite remember the name of the function but it's something like escape_string and it outputs a bunch of numbers like '90%89%%90332%'. I've used it on a site before to hide payment return URLs.

But as was said, it's not really possible considering the image is downloaded by the client user.
User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

Here is a way that makes it quite confusing. Make a 1 pixel transparent gif. Use this as the image for all your images. Then display the real image as a CSS background. That way when they right click and save they are saving the 1 pixel transparent image.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

why not randomly do a mixture? sure, the page will take a little longer to load, but then it'll be confusing as hell to actually get the data consistently :)
User avatar
phpdevuk
Forum Contributor
Posts: 220
Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:

Post by phpdevuk »

all good ideas
fine
Forum Newbie
Posts: 5
Joined: Thu Oct 13, 2005 4:15 pm

Post by fine »

User avatar
phpdevuk
Forum Contributor
Posts: 220
Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:

Post by phpdevuk »

yeah I suggested watermarking images with a logo, but the problem was more one of the images being downloaded rather than that.
Post Reply