SSL occurs a layer above HTTP, so HTTP/1.1 is correct.  HTTPS is not a
different data protocol, but a different transport protocol.


-----Original Message-----
From: Dee Ayy [] 
Sent: Friday, May 22, 2009 11:05 AM
Subject: [PHP] IE can't download, FF can: SSL ? Need special headers?

The following code has been working for about 6 years.  The only change
I am aware of is that now it is being served from a server requiring SSL
to access it.

header("Content-type: $type");
header("Content-length: $size");
header("Content-Disposition: attachment; filename=\"$name\""); echo

It still works in FF, so I assume the variables are being filled in.
For example:
header("Content-type: application/pdf");
header("Content-length: 75485");
header("Content-Disposition: attachment; filename=\"test.pdf\"");

In DebugBar HTTP(S) after the GET request which had to be authorized by
htaccess it reports:
HTTP/1.1 200 OK
Date: Fri, 22 May 2009 14:38:18 GMT
Server: Apache/2.0.50 (Fedora)
X-Powered-By: PHP/5.1.6
Set-Cookie: PHPSESSID=743ba4d8e056873c4da52b123df4b1ad; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
Pragma: no-cache
Content-length: 7359
Content-Disposition: attachment; filename="test.pdf"
Connection: close
Content-Type: application/pdf

Should "HTTP/1.1 200 OK" be "HTTPS/1.1 200 OK"?  If so, how can I get
that set?  Is there some funky header I need?

Oh, the IE 7 error is:
Internet Explorer cannot download my_php_file.php?a_name=a_value from

Internet Explorer was not able to open this Internet site.  The
requested site is either unavailable or cannot be found.  Please try
again later.

FYI: If the user cannot choose a filename to save as, it gets saved as
"my_php_file.php" which needs to be renamed to extension ".pdf" to be
viewed in a PDF viewer.
So if you have any helpful headers to force the filename, I'd appreciate
that too.  Apparently Content-Disposition: attachment;
filename="test.pdf" doesn't work (on FF and maybe other browsers).

There is an issue with Internet Explorer 6 that seems to relate, but this
is for IE 7, and I can't verify if it is also failing on IE 6.
But I found this (which didn't work for me)


PHP General Mailing List ( To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to