note 101209 deleted from function.header by danbrown
| From: | danbrown@php.net | Date: | Thu, 02 Dec 2010 14:14:26 +0000 |
| Subject: | note 101209 deleted from function.header by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-174563@lists.php.net to get a copy of this message | ||
Note Submitter: angelo.grieco AT gmail DOT com
----
hi there, i'm trying to generate a csv file and then force the download. Ok, the core code is
this:
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Content-Type: application/x-download");
header("Content-Disposition: attachment; filename=".$fileName);
header("Content-Transfer-Encoding: binary");
header("Pragma: public");
header("Cache-Control: private");
?>
then some loop stuff to generate the csv contents then
<?php
$path = $this->getFullFilePath();
ob_clean();
flush();
@readfile($path);
?>
Everything works fine but, as file size grows i start receiving 0kb files to download. Any clue
about this?
Many thanks