[thelist] Filename on php/gd-generated images

Maximillian Schwanekamp lists at neptunewebworks.com
Tue May 24 13:16:24 CDT 2005

Kasimir K wrote:
> <quote from="http://php.net/imagejpeg">...</quote>
Yeah, I got that part just fine.

> header("Content-type: image/jpg");
> header("Content-Disposition: "
>    . ($inline ? 'inline':'attachment')
>    . "; filename=$filename);
> imagejpeg($image);
> Using the variable $inline I can choose whether the image is displayed 
> on the browser or prompted for download.

That's more elegant, thanks.  I hadn't even thought of setting 
content-disposition as useful outside of initiating a download.  Darr.

Maximillian Von Schwanekamp

More information about the thelist mailing list