pedjasmek Posted November 10, 2007 Share Posted November 10, 2007 I'm using this code to force browser's download dialog.I have problem only with IE 6 because the downloaded file size is 0 bytes.Does anyone know why? $fp=fopen('c:\xampp\htdocs\pesme\R.E.M.-Losing_My_Religon.mp3','r'); $name=basename("c:\xampp\htdocs\pesme\R.E.M.-Losing_My_Religon.mp3"); $size=filesize('c:\xampp\htdocs\pesme\R.E.M.-Losing_My_Religon.mp3'); header('pragma: cache'); header('pragma: public'); header('Content-Type: audio/mpeg'); header('Content-Length:$size'); header("Cache-Control: private",false); header('Cache-Control: max-age=0'); header("Content-Transfer-Encoding: binary"); header("Content-Disposition: attachment;filename= $name"); fpassthru($fp); fclose($fp); Link to comment https://forums.phpfreaks.com/topic/76752-solved-forcing-download-dialog/ Share on other sites More sharing options...
toplay Posted November 10, 2007 Share Posted November 10, 2007 Try changing: header('Content-Length:$size'); To: header("Content-Length: $size"); Link to comment https://forums.phpfreaks.com/topic/76752-solved-forcing-download-dialog/#findComment-388619 Share on other sites More sharing options...
pedjasmek Posted November 10, 2007 Author Share Posted November 10, 2007 Thanks,man!I cannot believe that was all I had to do.I thought that ' ' and " " was the same. Link to comment https://forums.phpfreaks.com/topic/76752-solved-forcing-download-dialog/#findComment-388624 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.