Perfect File Protection
I have problems to make a good hotlink protector system.I use a php redirect file but I have a little problem with it.In this case when the user want to dl a file called 22.jpg he will be asked to dl the file as redirect.php.How can I keep the original file at download?
<?
if ( $HTTP_REFERER=="http://www.myname.com/images/members/") {
$filename="/home/images/data/" . $QUERY_STRING;
$mimetype = `file $filename | magic2mime`;
header("Content-type: $mimetype");
$fp = @fopen ($filename, "r") or die("Nincs ilyen file!");
while (!feof ($fp)) {
$buffer = fread($fp, 4096);
echo $buffer;
}
fclose($fp);
} else {
include("../../data/error.html");
}
?>
|