Cannot make bzip2 stream "on the fly"

From: Date: Tue, 31 Jan 2012 14:34:32 +0000
Subject: Cannot make bzip2 stream "on the fly"
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-316433@lists.php.net to get a copy of this message
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!

« previous php.general (#316433) next »