Re: File Download link not working in PHP 4.3.4
| From: | Curt Zirzow | Date: | Wed, 31 Mar 2004 03:55:33 +0000 |
| Subject: | Re: File Download link not working in PHP 4.3.4 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181893@lists.php.net to get a copy of this message | ||
* Thus wrote Andrew Hauger (a_hauger@yahoo.com):
> the file name. When the "OK" button is clicked, an
> error dialog pops up with the message "Internet
> Explorer cannot download ... [snipped URL]. Internet
> Explorer was not able to open this Internet site. The
> requested site is either unavailable or cannot be
> found. Please try again later."
This can mean a lot of things, IE tends to be too friendly
sometimes.
>
> Here are the header commands:
>
> $file_type = "vnd.ms-excel";
> $file_ending = "xls";
> header ( "Content-Type: application/$file_type" );
> header ( "Content-Disposition: attachment;
> filename=product.".$file_ending );
Quote the filename, although it most likley wont be the problem.
Conent-Type: attachment; filename="product.xls"
> header ( "Expires: 0" );
I might wage this is the problem, it needs to be a valid HTTP date,
something like this will do the job:
header('Expires: ' . date('r', 0);
Curt
--
"I used to think I was indecisive, but now I'm not so sure."