Page 1 of 1

GD Image Filename

Posted: Wed May 24, 2006 8:17 am
by jtmathome
When generating a GD image (.JPG in this case) and sending it directly to a browser using,

header ('Content-type: image/jpeg');

Is there any way of sending the filename too, so that if someone saves the image in thier browser the dialog would reflect the filename (picture.jpg) rather than the script name (imgcreate.php.jpg)? Thanks.

Posted: Wed May 24, 2006 12:16 pm
by jtmathome
I ended up using this...

header ("Content-Disposition: inline; filename=$FileName");

I subsituted "inline" for "attachment", so that downloading of the file is not automatic.

Thanks Much!