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); Quote Link to comment 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"); Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.