Re: [PHP] problem with header-dispotition in IE

2004-09-21 Thread Marek Kilimajer
adwinwijaya wrote:
The error that I got just IE cannot download download.php from
mysite.com .. IE was not able to open this site and bla bla bla. No
hint in the error.
I think the problem that I faced is with SSL.
I try http://www.wazzup.co.nz/tutorials/protect_pdf/index.php
and it didnt work on my web
Why IE cannot work with SSL mode to download file ?
Is there any solution ?
Are you using session? Then you need to use
session_cache_limiter('private_no_expire');
before starting the session.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] problem with header-dispotition in IE

2004-09-20 Thread adwinwijaya
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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with header-dispotition in IE

2004-09-20 Thread Marek Kilimajer
adwinwijaya wrote:
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 ?
I suppose you are trying to force IE to download the pdf file, but it is 
always displaying it - you did not tell what is your problem.

IE determines the type of file from the extension, if it is a known 
extension it ignores the content-type header. You might want to try 
adding space char after the filename, I've heard it works.

PS: Second param to header should be bool
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[2]: [PHP] problem with header-dispotition in IE

2004-09-20 Thread adwinwijaya
Hello Marek,

Monday, September 20, 2004, 6:58:46 PM, you wrote:

MK adwinwijaya wrote:
 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 ?

MK I suppose you are trying to force IE to download the pdf file, but it is
MK always displaying it - you did not tell what is your problem.

MK IE determines the type of file from the extension, if it is a known
MK extension it ignores the content-type header. You might want to try
MK adding space char after the filename, I've heard it works.

MK PS: Second param to header should be bool


The error that I got just IE cannot download download.php from
mysite.com .. IE was not able to open this site and bla bla bla. No
hint in the error.

I think the problem that I faced is with SSL.
I try http://www.wazzup.co.nz/tutorials/protect_pdf/index.php
and it didnt work on my web

Why IE cannot work with SSL mode to download file ?
Is there any solution ?

-- 
Best regards,
adwin
www.kuya-kuya.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with header-dispotition in IE

2004-09-20 Thread Brad Pauly
On Mon, 20 Sep 2004 10:58:46 +0200, Marek Kilimajer [EMAIL PROTECTED] wrote:
 
 I suppose you are trying to force IE to download the pdf file, but it is
 always displaying it - you did not tell what is your problem.
 
 IE determines the type of file from the extension, if it is a known
 extension it ignores the content-type header. You might want to try
 adding space char after the filename, I've heard it works.

Apparently IE sometimes makes multiple requests for a URI and this can
cause problems with large PDF files.

http://support.microsoft.com/default.aspx?scid=kb;en-us;293792

- Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php