Re: Naming image generated by ImageJPEG()
| From: | Rasmus Lerdorf | Date: | Sat, 06 Oct 2001 18:13:56 +0000 |
| Subject: | Re: Naming image generated by ImageJPEG() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70237@lists.php.net to get a copy of this message | ||
On Sat, 6 Oct 2001, Andy wrote:
> Hi guys
>
> I got a problem. Maybe you can help?
>
> This is the script file image.php:
> <?php
> Header("Content-type: image/jpeg");
> $im = imagecreatefromjpeg("picture.jpg");
> ImageJPEG($im);
> ImageDestroy($im);
> ?>
>
> It's called by index.html: <img src="image.php" ... >
>
> Problem: "Save picture as" results filename image.jpg (IE4)
> How can I name the file?
The trivial way is to make your img tag:
<img src="image.php/whatever.jpg" ...>
A Content-Disposition header should be able to do it as well.
-Rasmus