Hello friends,
I am working on downloading script. its working fine in all browsers.
but in IE when i click on download button its showing the size of every file zero bytes.
I have done lots of googling but didnot find anything. Please help its very urgent.
I am using the following function:-
function getDownloadData($fileid,$Finished='') {
//echo $fileid;
$url = "http://".$_SERVER['SERVER_NAME'] . '/uploads/fixfiles/';
//$product = mysql_fetch_assoc(mysql_query("select * from products where productId = '".$fileid."'"));
$file_path = $url.$fileid;
//die;
//echo $file_path = $server_path . 'uploads/products/downloads/'.$file;
//die;
$date = date('Y-m-d');
$sub = substr($fileid,-3);
//echo $sub1 = substr($file_path,-3); die;
$file_size =@filesize($file_path);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header('Last-Modified: '.date('r'));
header('Content-Description: File Transfer');
header('Content-Type: '.returnMIMEType($sub).'');
header("Content-disposition: attachment; filename=".$fileid."");
header("Content-Length: ".$file_path."");
header('Expires: 0');
ob_clean();
flush();
readfile($file_path);
exit;
}