hi i wrote this File Downloader script, but after downloading Bliss.gif it only loads part of it...see the attachment, how can i fix this problem? thx
<?
$ext="gif";
$filename="Bliss.gif";
switch ($ext){
case "gif":
$filemime="image/gif";
$cte=0;
break;
case "jpeg":
$filemime="image/jpeg";
$cte=0;
break;
case "exe":
$filemime="application/octet-stream";
$cte=1;
break;
case "zip":
$filemime="application/zip";
$cte=1;
break;
}
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: $filemime");
header("Content-Disposition: attachment; filename=".basename($filename).";");
if ($cte=="1"){
header("Content-Transfer-Encoding: binary");
}else{
header("Content-Transfer-Encoding: ascii");
}
header("Content-Length: ".filesize($filename));
readfile("$filename");
?>
Edited some hours later:
this problem is kind of solved...i was running this script under windows apache server all along, but when i uploaded to my host linux all worked out quite well