problem with header-dispotition in IE
| From: | adwinwijaya | Date: | Mon, 20 Sep 2004 06:33:40 +0000 |
| Subject: | problem with header-dispotition in IE | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-197251@lists.php.net to get a copy of this message | ||
Hi all ...
I have script that looks like :
if(file_exists($filename)){
$len = filesize($filename);
//header("Content-type: attachment/pdf");
header('Content-Type: application/pdf');
//header("Content-Type: application/octet-stream");
header("Content-Type: application/force-download");
header("Content-Length: $len");
if(preg_match("/MSIE/", $_SERVER["HTTP_USER_AGENT"])){
header("Content-Disposition: attachment;
filename=".$name.".pdf","pdf");
}else
{
header("Content-Disposition: attachment;
filename=".$name.".pdf","pdf");
}
//header("Content-Disposition: attachment;
filename=personal_inventory_forms.pdf");
readfile($filename);
} else
{
echo $filename ;
echo ' ERROR : file is not exist' ;
}
This script works very well on Mozilla, Opera and Safari..but doesnt
work with IE. can someone help me to solve this problem ?
thx
--
Best regards,
adwin
www.kuya-kuya.net
"There is a story living in us that speaks of our
place in the world.
It is a story that invites us to love what we love
and simply be ourselves."