Re: imagejpeg and downloading images
| From: | Doug Coning | Date: | Tue, 11 Mar 2003 21:47:27 +0000 |
| Subject: | Re: imagejpeg and downloading images | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139178@lists.php.net to get a copy of this message | ||
Thanks to everyone for their help.
The code below worked great! Thanks,
Doug Coning
----- Original Message -----
From: "adrian murphy@2020tourism.com" <adrian.murphy@2020tourism.com>
To: "Doug Coning" <doug@coning.com>; <php-general@lists.php.net>
Sent: Tuesday, March 11, 2003 11:57 AM
Subject: Re: [PHP] imagejpeg and downloading images
> try changing headers sent e.g
>
> header("Content-type: application/octet-stream");
> header("Content-Disposition: attachment; filename=001_SM77GR.jpg");
>
> $im = imagecreatefromjpeg("001_SM77GR.jpg");
> imagejpeg($im,'',85);
> imagedestroy($im);
>
> ----- Original Message -----
> From: "Doug Coning" <coning@coning.com>
> To: <php-general@lists.php.net>
> Sent: Tuesday, March 11, 2003 4:40 PM
> Subject: [PHP] imagejpeg and downloading images
>
>
> > Hi All,
> >
> > I'm using the following code to try to download images automatically
from
> a
> > directory:
> >
> > header('Content-Type: image/jpeg');
> > $im = imagecreatefromjpeg("001_SM77GR.jpg");
> > imagejpeg($im,'',85);
> > imagedestroy($im);
> >
> > I copied this code from PHP.net. However, when I run the above code, it
> > doesn't download the image, it just shows the image in the browser. I'm
> > using IE 6 for my browser.
> >
> > How I get PHP to download this image?
> >
> > Thanks!
> >
> > Doug Coning
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>