Re: Internet Explorer cannot download <filename> from www.domain.tld



yawnmoth wrote:

http://www.frostjedi.com/terra/scripts/demo/download2.php

Whenever I get that page, I get the following error:

---------------------

Internet Explorer cannot download download2.php from www.frostjedi.com.

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

---------------------

Here's the source code to download2.php:

<?php
session_start();
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="emails.csv"');
?>
a
b
...

If session_start() is commented out, it works just fine. I've
narrowed the problem to a particular header that's being transmitted.
Namely, this one:

header('Cache-Control: no-store, no-cache, must-revalidate, post-
check=0, pre-check=0');

If you replace session_start() with that, you'll get the same error.
The only thing is... I'm not sure why that header is being added. I
can fix it by adding header('Cache-control: private');, but I'd still
like to know why it's being added in the first place.

Known problem: MSIE not storing it in cache, and hence nnot downloadable.
The cache headers are probably from your session_start() (look at your ini
session settings, cache control is one of them).
--
Rik
.



Relevant Pages

  • Re: question on header() function
    ... example it looks like it is for cache control? ... what is the status header for or rather how does it work? ... can get some status information from the server? ... page unless you wanted the user to download the same data as what he ...
    (comp.lang.php)
  • Re: question on header() function
    ... example it looks like it is for cache control? ... can get some status information from the server? ... conjunction with a header request? ... page unless you wanted the user to download the same data as what he ...
    (comp.lang.php)
  • Re: save as file
    ... Thanks David, I've just reduced mine, never really bothered to look at the cache - ... I tend to download large pdfs and updates mainly for my programs. ... In Internet Explorer, click Tools, and then click Internet Options. ... Clear Never compress graphics. ...
    (microsoft.public.windowsxp.general)
  • Re: [PHP] Re: Strategy for Secure File Storage
    ... "Internet Explorer cannot download test.pdf from XXX...." ... The problem with IE was when you told it not to cache the document. ... Adobe plug-in handle it, as it looks like you intend with the ...
    (php.general)
  • Re: Size of a remote URL
    ... Internet Explorer knows the size of something that my code cannot ... asking the server the right question. ... Maybe I need to ask for that header more ... incorporate this code directly into my download funciton so that as ...
    (comp.lang.python)