note 68741 added to function.readfile
| From: | rhoward at progsoc dot uts dot edu dot removethis dot au | Date: | Wed, 09 Aug 2006 01:39:04 +0000 |
| Subject: | note 68741 added to function.readfile | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115712@lists.php.net to get a copy of this message | ||
We've just run into a problem where certain PDF files are only partially printed when
readfile() is being used inside a buffer. To fix this, you need to add an @ob_flush() after the call
to readfile(), eg.
<?php
ob_start();
readfile('example.file');
// use @ to hide 'nothing to flush' errors
@ob_flush();
$content = ob_get_contents();
ob_end_clean();
?>
----
Server IP: 203.202.10.60
Probable Submitter: 60.227.178.243
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.readfile.php
Edit -- https://master.php.net/note/edit/68741
Del: integrated -- https://master.php.net/note/delete/68741/integrated
Del: useless -- https://master.php.net/note/delete/68741/useless
Del: bad code -- https://master.php.net/note/delete/68741/bad+code
Del: spam -- https://master.php.net/note/delete/68741/spam
Del: non-english -- https://master.php.net/note/delete/68741/non-english
Del: in docs -- https://master.php.net/note/delete/68741/in+docs
Del: other reasons-- https://master.php.net/note/delete/68741
Reject -- https://master.php.net/note/reject/68741
Search -- https://master.php.net/manage/user-notes.php