Cannot make bzip2 stream "on the fly"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=f.bzip2");
header("Content-Type: application/x-bzip2");
//header("Content-length: " . strlen($zippedfile) . "\n\n");
header("Content-Transfer-Encoding: binary");
ob_flush();

$bz = bzopen( 'php://output' , 'w' ); if ($bz===FALSE) { echo "FALSE"; return; }
bzwrite($bz,"hi");
bzclose($bz);

bzopen returns error:
bzopen(): cannot represent a stream of type Output as a File Descriptor

in case using stdout instead of output it works but produce zero result.

Following works ok:

$z = fopen( 'php://output' , 'w' );
if ($z===FALSE) { echo "FALSE"; return; }
fwrite($z,"hihi");
fclose($z);

Please, help!



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux