note 101209 added to function.header
| From: | angelo dot griecoATgmailDOTcom at osu1 dot php dot net | Date: | Thu, 02 Dec 2010 10:51:37 +0000 |
| Subject: | note 101209 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174555@lists.php.net to get a copy of this message | ||
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
----
Server IP: 69.147.83.197
Probable Submitter: 217.41.39.169
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/101209
Del: integrated -- https://master.php.net/note/delete/101209/integrated
Del: useless -- https://master.php.net/note/delete/101209/useless
Del: bad code -- https://master.php.net/note/delete/101209/bad+code
Del: spam -- https://master.php.net/note/delete/101209/spam
Del: non-english -- https://master.php.net/note/delete/101209/non-english
Del: in docs -- https://master.php.net/note/delete/101209/in+docs
Del: other reasons-- https://master.php.net/note/delete/101209
Reject -- https://master.php.net/note/reject/101209
Search -- https://master.php.net/manage/user-notes.php