imangh Posted January 3, 2008 Share Posted January 3, 2008 hello I have a problem with a page that let users to download file. It work correctly from IE but not in FF! file in FF is 25 byte lest than file downloaded by IE in length. if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT'])) { ob_end_clean(); } if(!file_exists(FilesDirectory.$FileName)) { echo "Invalide request!"; exit(); } header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header("Content-type: application/zip"); header("Content-Disposition: attachment; filename=\"".md5($FileName).".zip\""); if ('IE') { header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); } else { header('Pragma: no-cache'); } header('Cache-Control: max-age=604800'); header("Content-Length: ".@filesize(FilesDirectory.$FileName)); readfile(RootDirectory."files/".$FileName); in configuration file I used ob_start("ob_gzhandler") I try to solve problem by placing ob_end_clean(), some time IE have error and some time FF. I don't know what to do exactly! Quote Link to comment https://forums.phpfreaks.com/topic/84371-file-download-problem/ 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.