phat_hip_prog Posted March 12, 2007 Share Posted March 12, 2007 Hi, I'm generating images by way of GD, but when it's saved through the browser it has the php script's name (e.g. 'genimg.php'). Therefore i'm trying to set the name using 'header()', i'm not sure if this is the way to do it since it's not working. I used the 'filename' bit from 'attachment'. e.g: .. header("Content-type: image/png; filename=\"img.png\""); $im = ImageCreate(200, 200); $black = ImageColorAllocate($im, 0, 0, 0); $red = ImageColorAllocate($im, 255, 0, 0); ImageFilledRectangle($im, 0, 0, 200, 200, $black); ImageFilledRectangle($im, 25, 25, 75, 75, $red); # Output the image to the browser ImagePng($im); .. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/42364-filename-setting-in-header-for-gd-creations/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.