RE: [PHP] IMG generation
| From: | Mark Olbert | Date: | Wed, 11 Oct 2000 21:51:31 +0000 |
| Subject: | RE: [PHP] IMG generation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19708@lists.php.net to get a copy of this message | ||
Actually, it works fine, now that I've figured out what the problem was.
- Mark
-----Original Message-----
From: John Donagher [mailto:john@webmeta.com]
Sent: Wednesday, October 11, 2000 8:31 AM
To: Zipkid
Cc: php-general@lists.php.net
Subject: Re: [PHP] IMG generation
I don't see how you can access this file this way.
If you're accessing this file locally, it will not *run* the script, it will
just fopen() and read in the contents of the file. This is not what you want
to do. If you access this file through the web server (i.e. over http
instead of local filesystem access), the web server will execute it and send
the resultant data (presumably your binary image data).
John
On Wed, 11 Oct 2000, Zipkid wrote:
> Mark Olbert wrote:
> >
> > I have an html file that looks like this:
> >
> > <html>
> > <img src="/php/displayimage.php">
> > </html>
> >
> > When I browse this file, I get a "premature end of script headers
error".
> >
> > If I execute the file from the command line and capture the output, I
get
> > the following (I've truncated some of the later lines):
> >
> > X-Powered-By: PHP/4.0.2
> > Content-type: image/jpeg
> >
> > ÿØÿà^@^PJFIF^@^A^A^@^@^A^@^A^@^@ÿþ^@;CREATOR: gd-jpeg v1.0 (using IJG
JPEG
> > v62), quality = 30
> > ÿÛ^@C^@^[^R^T^W^T^Q^[^W^V^W^^^\^[
> > (B+(%%(Q:=0B`Ued_U][jx~^Y~^Ajq~^Ps[]~^Eµ~^F~^P~^^£«
> >
^KÿÄ^@µ^P^@^B^A^C^C^B^D^C^E^E^D^D^@^@^A}^A^B^C^@^D^Q^E^R!1A^F^SQa^G"q^T2~^A~
> > ^Q¡)*
> >
> > This >>looks<< like image data. So why is the browser rejecting it?
> >
>
> in /php/displayimage.php, before any other output you have to put
>
> header( "Content-type: image/jpeg" );
>
> so long
>
--
John Donagher
Application Engineer
Intacct Corp. - Powerful Accounting on the Web
408-395-0989
720 University Ave.
Los Gatos CA 95032
www.intacct.com
-----BEGIN PGP PUB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qKAR75M9izDliT7Y
h5L+QZTAw0/5X9go7XK3WI3LYfFrp4TP0veXgSWxDqccqsRzWKW7IoXsliTCbVqI
RgQYEQIABgUCOcJnYwAKCRAi3q1W7r6N3YIcAKCkJMTPLu6tOPnXPl2s3xmnSawy
BACeOx83WlBhVScYWo+BUzntJ6ks4T0=
=OkJU
-----END PGP PUBLIC KEY BLOCK-----
--
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