Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: protect images from download



I'm not sure what having a PC and/or having money has to do with the issue... nor why having a mac makes it any more difficult... unless the only solutions that you have found revolve around placing some kind of active-X control on the site and then forcing the user to install that (which anyone in the know sure as crap draws flies wouldn't install some active-x control just to view a website  -- dis-regarding flash of course) and also ignores the 35 to 40% of the browser market that isn't IE based (Firefox [20 to 30%], Opera [~1% but very loyal followers], Safari[~3 to ~5% and also tend to have loyal followers] because none of the other browsers run Active-X controls.

But... in addition to Shashwat has mentioned, you can set up a server side script to hand out the images.

it would be a bit of a pain and it would require a bit of work to set it up, but it would ultimately protect your images from being hotlinked and or viewed prematurely if you have time released content

basically the image would be referred to in the code as <img src="" image.php?id=(some number)" alt="something" />

then the php file would take in the number, do whatever kind of processing with that number and then check it against a translation table that has all of your images in it and then do something along the lines of:

( remember that this file should not go in the same folder as your images, this code hasn't been, and if you don't want your images taken - don't put them on the internet, because if someone wants them -- they will get them)

<?
//set filename to false to prevent any errors from memory corruption etc
// or in case its used somewhere in a script that includes this file

$filename = false;
if (isset($_GET['id'])){
  $result = checkTranslationTable($_GET['id')
  $file_name = ($result != false) ? $result : false
    if($file_name){}
    showMyImage($filename);
    }else{
    showfail();
    exit;
  }
}else{
  showfail();
  }
function showMyImage($filename){
  $file_type = substr($file_name,0,-3);//use substr magic to get the ext
    header('Content-type: image/'.$file_type);
    header('Content-Disposition: attachment; filename="'.$file_name.'";');
    readfile($file_name);
}
function showfail(){
  /* you can hand out a really effed up image or you can hand out a 404
   
    header( "HTTP/1.0 404 Not Found" );
    exit ;
   
  */
}
function checkTranslationTable($id){
  /*
    this is where you can check against a DB, global array, or just regular list
    etc you may also want to put in place an algorithm that will change alter
    the id of the images randomly or even if you just use the time() function to
    "randomize" the names, this would really mess with someone who tries to hotlink
    because even if they did figure out that the id is changed based on the
    time() function, they would have to make their server get in synch with yours
    for them to dynamically be able to create the correct id -- which would be
    in vain if you have a rewrite rule saying that no other domains are allowed
    to "read" from the images directory (see noet below)
    */
)
?>

just remember: just as the others have said: this will not prevent people from saving the image with a right click or screen cap and prevention of hotlinking to your images is a lot easier (look up mod_rewrite stop image hotlink on google)

sorry for being so long winded, but, good luck


On Sat, Apr 19, 2008 at 11:54 AM, Shashwat Parhi <email@hidden> wrote:
Well, all these posts are spot on in terms of accuracy. However, if all you are interested is in upping the barrier to ease of stealing your pictures, place a div on top of your image with a transparent gif as it's background. Won't stop a determined thief but may prevent most casual visitors to your site from getting easy access.

Shashwat


On 19-Apr-08, at 9:18 PM, Scott Reynen wrote:

On Apr 19, 2008, at 9:12 AM, Robert Poland wrote:

[protecting images from download] seem like it should be a simple thing.

It is simple: don't put the image on the web.  The web is all about downloading.  Everything a browser displays is downloaded first.  Trying to control what happens after something is downloaded is both futile and offensive, like sending someone postcard and telling them they can't put it on their fridge.

Peace,
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden

References: 
 >protect images from download (From: Robert Poland <email@hidden>)
 >Re: protect images from download (From: Scott Reynen <email@hidden>)
 >Re: protect images from download (From: Shashwat Parhi <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.