Simple Downloader Script

Description: A simple downloader script.

<?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);
 
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.