note 105680 added to function.readfile
| From: | immanuel at ftfdesigns dot com | Date: | Tue, 06 Sep 2011 22:59:23 +0000 |
| Subject: | note 105680 added to function.readfile | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182995@lists.php.net to get a copy of this message | ||
It seems an IF Statement right before preparing a readfile() corrupts the file being download.
There are probably similar actions that would result in this same problem but I found this out while
using an IF statement (unrelated to the download process) before writing headers for a readfile().
I recommend including the ob_clean() function after the headers i.e. as shown in Example 1.
Many snippet codes for readfile() functions out there tend to skip ob_clean(); so double-check
it's there before/after pasting that code.
:)
----
Server IP: 69.147.83.197
Probable Submitter: 174.0.55.57
----
Manual Page -- http://www.php.net/manual/en/function.readfile.php
Edit -- https://master.php.net/note/edit/105680
Del: integrated -- https://master.php.net/note/delete/105680/integrated
Del: useless -- https://master.php.net/note/delete/105680/useless
Del: bad code -- https://master.php.net/note/delete/105680/bad+code
Del: spam -- https://master.php.net/note/delete/105680/spam
Del: non-english -- https://master.php.net/note/delete/105680/non-english
Del: in docs -- https://master.php.net/note/delete/105680/in+docs
Del: other reasons-- https://master.php.net/note/delete/105680
Reject -- https://master.php.net/note/reject/105680
Search -- https://master.php.net/manage/user-notes.php