Serving out a file to Firefox ... headers?
| From: | Brian Dunning | Date: | Fri, 24 Nov 2006 04:40:37 +0000 |
| Subject: | Serving out a file to Firefox ... headers? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-245108@lists.php.net to get a copy of this message | ||
Sorry to revisit this issue YET ONE MORE TIME... :) :)
My online store sends out the file for download upon purchase. Below are the headers I send, and I understood that it should work for all browsers. It does not work for Firefox. Suggestions?
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$filename);
$size = filesize('../../store/files/'.$filename);
header('Content-Length: '.$size);
readfile('../../store/files/'.$filename);