View Single Post
Old 2005-08-17, 08:48 PM   #9
pornoTGB
Shut up brain, or I'll stab you with a Q-tip!
 
pornoTGB's Avatar
 
Join Date: Jun 2005
Location: Austria
Posts: 118
Send a message via ICQ to pornoTGB
I think the best way of protecting your files is by creating them dynamicly. Yes.. this does drive up the server-load but files are safe! No direct downloads, hotlinks..
Just put lets say your images into a htaccess-protected folder.
Make a new php-file in your root that you protect by handing over correct varaibles with the header of the desired file type.

for instance for a jpg you would want:
PHP Code:
header('Last-Modified: '.gmdate('D, d M Y H:i:s'$timestamp).' GMT');  header("Content-type: image/jpeg");    $im imagecreatefromjpeg("YOURIMAGE");    imagejpeg($im''100);  imagedestroy($im); 
in that file.. watch out that there is no text in the output! .. for a gif just exchange the content-type header to image/gif
Doing this with animated gifs is a bit more work..
a lot of help are the post on php.net when searching for a function.
pornoTGB is offline   Reply With Quote