Re: [Newman] Passing an image through a php file.
| From: | Mark Tehara | Date: | Fri, 20 Jun 2003 03:19:14 +0000 |
| Subject: | Re: [Newman] Passing an image through a php file. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152267@lists.php.net to get a copy of this message | ||
<?php
$myimage="..//..//site//images//2.jpg";
header("Content-type: image/jpeg");
fopen ("$myimage", "r");
readfile("$myimage") ;
fclose("$myimage");
?>
This seemed to do the trick for me. Thank you.
/ Mark
----- Original Message -----
From: "CPT John W. Holmes" <holmes072000@charter.net>
To: "Awlad Hussain" <php@sheridan-phoenix.com>; "Mark Tehara"
<me@philipsdomain.com>; "PHP" <php-general@lists.php.net>
Sent: Friday, June 20, 2003 1:14 AM
Subject: Re: [PHP] [Newman] Passing an image through a php file.
> > try this:
> > <?php
> >
> > header("Content-type: image/jpeg");
> > fopen ("d:/crushme/images/1.jpg", "r");
>
> Just my opinion, but maybe you should try reading the file and echoing the
> data instead of just opening it. :)
>
> ---John Holmes...
>
>
> > I would like to pass an image throught
> > http://server/newman/ImageTEST/image.php
> >
> > 1. I need the headers (Assuming) <? header("Content-type: image/jpeg");
> ?>
> > would make the computer think its a image file.
> > 2. load the image using fopen ("d://crushme//images//1.jpg", "r");
> >
> >
> > <?php
> >
> > header("Content-type: image/jpeg");
> > fopen ("d://crushme//images//1.jpg", "r");
> >
> > ?>
> >
> >
> > The image
> > "http://server/newman/ImageTEST/image.php" cannot be
displayed,
> > because it contains errors.
> >
> > This returns this error (above)
> >
> > Yes 1. Image is in the right location.
> > Yes 2. I'm stuck.
> >
> > Any Suggestions would be very good.
>
>