Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/84371-file-download-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.