Snippet Name: Simple downloader script
Description: A simple downloader script.
Comment: (none)
Language: PHP
Highlight Mode: PHP
Last Modified: March 01st, 2009
|
<?PHP
//
//The download directory where the files are placed.
//The trailing slash is a must!
$dloadsdir = '/files/'
$counter = 'count.txt';
$cf = FOPEN($counter, "w+");
FPUTS($cf, "$_GET['file']");
FCLOSE($cf);
$file = $_GET['file'];
$fp = FOPEN($file,"rb");
$fsize = FILESIZE($file);
HEADER("Content-type: application/download \r \n");
HEADER("Content-length: $fsize \r \n");
FPASSTHRU($fp);
FCLOSE($fp);
?>
|