Using http headers to download a file. Firefox works but IE doesn't

I

igorcarajo

Hello,

I am using php to send http headers back to the client to start a
download, so that when the client requests "test.php", it gets the file
"xyz.msi" sent back. The headers that the client receives look like
this (I am using the same headers that osCommerce uses for downloads):

HTTP/1.x 200 OK
Date: Tue, 11 Jul 2006 21:31:17 GMT
Server: Apache/2.0.50 (FreeBSD) PHP/4.3.10
X-Powered-By: PHP/4.3.10
Expires: Mon, 26 Nov 1962 00:00:00 GMT
Last-Modified: Tue,11 Jul 2006 21:31:22 GMT
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
content-disposition: attachment; filename=xyz.msi
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: Application/octet-stream

Well, this works fine with Firefox 1.5 and Mozilla 1.7, but Internet
Explorer 6 fails with an error message that says "Internet Explorer
cannot download test.php from localhost. Internet Explorer was not able
to open this Internet site. The requested site is either unavailable or
cannot be found. Please try again later."

Can anyone help me figure out what the problem is? Thanks in advance.
 
I

igorcarajo

Update: I eliminated the error by removing the header "cache-control",
but now IE just displays the msi file on the screen. I think I read
somewhere that IE doesn't pay much attention to the "content-type"
header and instead tries to guess what type the content is. Is this
correct? If so, how can I trick IE into not displaying it? Should I zip
the file? Thanks.
 
R

Rik

I might be talking out of my ass here, bu seeing as you haven't had an
answer yet: perhaps
Content-disposition: attachment; filename="xyz.msi"
^-----------------------------------------^-------^

Grtz,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top