Skip to main content.
home | support | download

Back to List Archive

Re: Using prog, how do I seperate files?

From: Eric Estabrooks <eric_estabrooks(at)not-real.yahoo.com>
Date: Thu Mar 27 2003 - 04:11:36 GMT
That didn't help. Since I'm running PHP on Windows 2K, I am now opening the
stdout in binary mode. Still nothing. I know it's got to be something
simple. Does anyone have a guess?


$this->stdout = fopen( "php://stdout", "wb");

fwrite( $this->stdout, "Path-Name: " . $row['docID'] . "\n");
fwrite( $this->stdout, "Content-Length: " . strlen( $theDoc ) . "\n\n");
fwrite( $this->stdout, $theDoc);

-ece

-----Original Message-----
From: swish-e@sunsite.berkeley.edu
[mailto:swish-e@sunsite.berkeley.edu]On Behalf Of Bill Moseley
Sent: Wednesday, March 26, 2003 10:11 AM
To: Multiple recipients of list
Subject: [SWISH-E] Re: Using prog, how do I seperate files?


On Tue, 25 Mar 2003, Eric Estabrooks wrote:

> In PHP I am streaming records out of my database into swish-e. 1 record
> works fine but as soon as I try 2 I get the following error:
>
> b4a748943bd4b0ddbb629169c771eddf:131: error: Extra content at the end of
the
> doc
> ument
> Path-Name: 82c3453c9c33ebf2df361159391bb126
> ^
>
>
> b4a748943bd4b0ddbb629169c771eddf is the name of the first doc.
> 82c3453c9c33ebf2df361159391bb126 is the second doc.
>
> The code goes something like this:
> 		while($row = mysql_fetch_assoc ( $all )){
>  			$theDoc = gzuncompress($row['doc']);
>  			echo("Path-Name: " . $row['docID'] . "\n");
>  			echo("Content-Length: " . strlen( $theDoc ). "\n");
>  			echo("\n");
>  			echo($theDoc);
>  			echo("\n");
>  		}

You are passing the Content-Length as strlen( $theDoc ), but then you are
printing an extra \n at the end.

Does something like this work?

               while($row = mysql_fetch_assoc ( $all )){
                       $theDoc = gzuncompress($row['doc']);
                       echo("Path-Name: " . $row['docID'] . "\n");
                       echo("Content-Length: " . strlen( $theDoc). "\n\n");
                       echo($theDoc);

--
Bill Moseley moseley@hank.org
Received on Thu Mar 27 04:15:32 2003