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

Reply via email to