Re: FW: [PHP] Re: Generating an Excel file?
| From: | Ben Ramsey | Date: | Tue, 20 Jan 2004 15:14:29 +0000 |
| Subject: | Re: FW: [PHP] Re: Generating an Excel file? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175146@lists.php.net to get a copy of this message | ||
John W. Holmes wrote:
From what I've seen on here, the only workaround is to pass an extra variable in the URL that ends in ".csv", even though you don't need to use that variable. file.php?var=whatever&dummy=f.csvOlwen - Sal Williams wrote:
Name it for example something.csv The in your .htaccess file put <Files something.csv> ForceType application/x-httpd-php </Files>Vincent Jansen wrote:
I use header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header( "Content-type: application/x-excel" ); header( "Content-Disposition: attachment; filename=MyFile.xls" ); header( "Content-Description: PHP Generated Data" ); For me this works in both IE6 and Mozilla 1.5None of these ideas seem to work. In fact, I don't think .htaccess files even work on a Windows server running IIS. But I could probably achieve the save results by playing with the extensions in IIS. At any rate, I tried it in IE6, and it prompts me to download it correctly and without the ".php" extension on the end. I had been trying it in Mozilla Firebird 0.7 prior to that. Since the client uses IE rather than Mozilla, then I won't worry about it for now. However, it still would be a good idea to find a way to resolve it. Any other ideas? Thanks, Ben