In hopes that this may be of help to you...I had a hell of a time getting IE
to download pdfs that I create on the fly and finally with the help of a
couple people I got the magic code which was...

$len = strlen($buf);  //buf was holding the pdf doc.

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=".$filename.".pdf");
header("Content-Transfer-Encoding: binary");

and in addition had to set the link as <a
href=http://mysite.com/myphpPDFscript.php?pdf=anything.pdf

and after all of that it worked.  Which ones you may need is beyond me.  I
do not know enough about how the different browsers handle headers and
really only needed to get that one functionality working for me.  I hope
examining it can help...

Larry

-----Original Message-----
From: Andreas Magnusson [mailto:[EMAIL PROTECTED]
Sent: Monday, December 22, 2003 1:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: HTTP headers, IE and downloading


Thanks for your reply!

> Have a look at: http://pear.php.net/package/HTTP_Download

I looked at it and it's hard to see what it does differently from what I
do...


> And the first comment of:
> http://www.php.net/manual/en/function.session-cache-limiter.php

Thanks, I've read that and I'm not using output compression.


> Perhaps you should not use ouput-compression, and look at the headers
> generated by PHP
>
> What headers are sent? Do you use sessions?

I use sessions, and I've tried to send the same headers as the webserver
sends if I download a file directly (rather than through PHP).
It doesn't work... Maybe I should just create a temporary file and relocate
the browser to it in case the browser is IE...

> you can see this using Mozilla + Live Headers, Ethereal,
> http://schroepl.net/cgi-bin/http_trace.pl ...

Thanks, I've written my own HTTP header tracer in C++, but it hasn't been
able to help me since the headers looks good to me...

/Andreas

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

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

Reply via email to