Re: weird http header problem with rlib_get_content_length

Bob Doan <[email protected]> Fri, 29 Jun 2007 16:14:11 -0400
Newsgroups gmane.text.rlib.user
Message-ID <[email protected]>
Hi,

Doing something like this will work also:

$my_header = split("\n", rlib_get_content_type($rlib));
foreach($my_header as $x) {
	if($x != '')
		header($x);
}


On Sat, 2007-06-23 at 15:35 +0200, michiel wrote:
> It looks like the php header function does not like the newline between 
> Content-Type and Content-Length in PHP 5.16
> if I do:
> 
> header(rlib_get_content_type($rlib), true);
> rlib_spool($rlib);
> rlib_free($rlib);
> 
> The header does not set correctly and PDF's are displayed as text in the 
> browser
> 
> However:
> 
> $hh = rlib_get_content_type($rlib);
> $cl = strpos($hh, 'Content-Length');
> $ctype_string = substr($hh,0,$cl);
> $clength_string = substr($hh, $cl);
> header(trim($ctype_string), true);
> header(trim($clength_string));
> rlib_spool($rlib);
> rlib_free($rlib);
> 
> It works fine!
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Rlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rlib-users
-- 
Bob Doan
Vice President of Information Technology
SICOM Systems
[email protected]
800-547-4266 x217


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/