You are here: Re: Using http headers to download a file. Firefox works but IE doesn't « HTML « IT news, forums, messages
Re: Using http headers to download a file. Firefox works but IE doesn't

Posted by igorcarajo on 07/12/06 15:04

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.



igorcarajo@yahoo.com wrote:
> 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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация