Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2005-08-17, 08:48 PM   #11
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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:01 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc