Re: fgets
| From: | Christian Reiniger | Date: | Thu, 30 Aug 2001 16:18:02 +0000 |
| Subject: | Re: fgets | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65322@lists.php.net to get a copy of this message | ||
On Wednesday 29 August 2001 23:45, Christopher William Wesley wrote:
> On Wed, 29 Aug 2001, Joseph Bannon wrote:
> > I want to use fgets to get an image off the server and then print it.
> > Kinda like if you call the script picture.php, an image will appear.
> > How do I do
>
> I do this, with fopen() and fpassthru() ...
>
> $im = fopen( "myImage.jpg", "r" );
> if( !$im ){
> // FILE WASN'T FOUND
> } else {
// important:
header ("Content-Type: image/jpeg"); // or image/png
> // ALL GOOD - SEND IT TO THE BROWSER
> fpassthru( $im );
> }
> fclose( $im );
--
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)
CPU not found. retry, abort, ignore?