hejsan!
jag håller på med att experimentera med ett "download-script" i php, som jag hittade här i php-forumet (jag kan inte php...)
jag undrar om det är möjligt att skriva om scriptet till asp ??
på så sätt skulle jag förstå lite mer...och kunna modifiera scriptet, och kanske kunna använda sql i det.
scriptet:
<?php
$redirectpage = "error.php";
// where to go if $validreferer != $HTTP_REFERER
$validreferer = "test.htm";
// pages which are allowed to call this script without beeing automatically redirected to $redirectpage
$dir = "c:\\inetpub\\wwwroot\\test\\php\\wfDL\\";
// dir where the files are stored
// could also be a complete url, ('http://www.yourpage.com/dir/')
$files = array (
"01" => "$dir|bild_1.jpg",
"02" => "$dir|2.zip",
"03" => "$dir|3.zip",
"04" => "$dir|4.zip"
);
// list your files in this array
// "[id#]" => "[url/dir where the files are stored]|[filename]"
if (eregi($validreferer,$HTTP_REFERER)) {
$permission = 1;
} else {
$permission = 0;
}
list($path,$filename) = explode("|","$files[$id]");
if ($path == "" || $filename == "") {$permission = 0;}
if ($permission == 1) {
header("Content-Disposition: atachment; filename=$filename");
header("Content-Type: application/octet-stream");
header("Content-Length: ".filesize("$path/$filename"));
header("Pragma: no-cache");
header("Expires: 0");
$fp=fopen("$path/$filename","r");
print fread($fp,filesize("$path/$filename"));
fclose($fp);
exit();
}
if ($permission == 0) {header("Location: $redirectpage");}
?>
är det någon som kan det ?
/henrik
------------------
...