RE: [PHP] Passing files to a browser

From: Date: Thu, 08 Feb 2001 19:26:08 +0000
Subject: RE: [PHP] Passing files to a browser
Groups: php.general 
Request: Send a blank email to php-general+get-38804@lists.php.net to get a copy of this message
Actually, if you read the manual entry for fpassthru, it states that the filehandle will be closed by fpassthru upon reading. So you're trying to close your filehandle twice... get rid of the fclose($fp) at the end and you should be fine. -jm -----Original Message----- From: Christian Reiniger [mailto:creinig@mayn.de] Sent: Thursday, February 08, 2001 11:19 AM To: php-general@lists.php.net Subject: Re: [PHP] Passing files to a browser On Thursday 08 February 2001 18:43, Rob Root wrote: > <?php > $fp = fopen("test.txt", "r"); > header("content-type: text/plain"); > fpassthru($fp); > fclose($fp); > ?> > > And got: > Hello, World > <br> > <b>Warning</b>: 1 is not a valid File-Handle resource in > <b>/home/robr/public_html/php/getpdf.php</b> on line <b>5</b><br> That most likely means the fopen () failed. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) This is JohnC IMHO, I compaired tri-word groupings here and in his plan and got a good match. - /. posting discussing the likelihood that an AC post that claimed to be posted by John Carmack during his honeymoon (and having the login info at home) was actually from him. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#38804) next »