the code work only in the localhost
Posted: Tue Nov 24, 2009 9:59 pm
i use this code to make a download page and hide the link and limit the speed of download
it's work on the localhost Perfectly But when i try to use it on my site the page still loading forever and the download does not start
can u help me ??[/b]
it's work on the localhost Perfectly But when i try to use it on my site the page still loading forever and the download does not start
can u help me ??
Code: Select all
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header('Accept-Ranges: bytes');
header('HTTP/1.1 206 Partial Content');
header("Content-Transfer-Encoding: binary");
header("Content-length: ".filesize($filename));
header("Content-type: $filetype");
header("Content-Disposition: attachment; filename=\"" . basename($filename) . "\"");
$file = fopen($filename, "r");
while(!feof($file)) {
// send the current file part to the browser
echo fread($file, round($download_rate * 1024));
// flush the content to the browser
flush();
// sleep one second
sleep(1);
}
// close file stream
fclose($file);