note 87928 added to function.bzopen
| From: | KrazyBox at osu1 dot php dot net | Date: | Wed, 31 Dec 2008 01:44:58 +0000 |
| Subject: | note 87928 added to function.bzopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148705@lists.php.net to get a copy of this message | ||
In some circumstances, you may want to send a bzip2 stream to the client.
To do this, you need only do:
<?
ob_flush();
$bz = bzopen('php://stdout', 'w');
bzwrite($bz, 'some input here');
bzclose($bz);
?>
However, please note, because you are using STDOUT, you need to ob_flush() before actually writing
to the stream. Otherwise, you might be sending data before the headers, which will cause errors on
both server and client ends, in most cases.
You might be able to use php://output rather than php://stdout, however in my tests (with Linux),
php://output doesn't actually work - at all.
----
Server IP: 69.147.83.197
Probable Submitter: 24.102.58.146 (proxied: 127.0.0.1)
----
Manual Page -- http://www.php.net/manual/en/function.bzopen.php
Edit -- https://master.php.net/note/edit/87928
Del: integrated -- https://master.php.net/note/delete/87928/integrated
Del: useless -- https://master.php.net/note/delete/87928/useless
Del: bad code -- https://master.php.net/note/delete/87928/bad+code
Del: spam -- https://master.php.net/note/delete/87928/spam
Del: non-english -- https://master.php.net/note/delete/87928/non-english
Del: in docs -- https://master.php.net/note/delete/87928/in+docs
Del: other reasons-- https://master.php.net/note/delete/87928
Reject -- https://master.php.net/note/reject/87928
Search -- https://master.php.net/manage/user-notes.php