note 32276 deleted from function.header by sniper
| From: | sniper@php.net | Date: | Sun, 07 Sep 2003 21:43:54 +0000 |
| Subject: | note 32276 deleted from function.header by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55651@lists.php.net to get a copy of this message | ||
Note Submitter: rajka@6deex.net
----
I was trying to download a CSV file using IE6 SP1, but it was displayed in the window by excel: I
was using "Application/octet-stream" as Content-type. So after a little search, I found a
type/subtype pair that works, the code looks like this:<br>
header("Content-type: text/tab-separated-values");
header("Content-Length: ".filesize($fpath));
header("Content-Disposition: filename=".basename($fpath));
readfile($fpath);
exit;<br>
I stripped out every error check, just to shorten the code. None of the users notes worked for me, I
hope this will be useful for somebody.