GD Image Filename

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jtmathome
Forum Newbie
Posts: 2
Joined: Wed May 24, 2006 8:10 am

GD Image Filename

Post 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.
jtmathome
Forum Newbie
Posts: 2
Joined: Wed May 24, 2006 8:10 am

Post 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!
Post Reply