开发者

Not able to save the image created using php

I am adding some text to an image using PHP and then outputting it using:

header('Content-type: image/jpeg');
imagejpeg($rImg, NULL, 100);

The image 开发者_开发技巧is displayed correctly, but when I right click to save the image, it saves it as a PHP file and not an image. What am I doing wrong?


you have add a header for the file name

example:

header('Content-Disposition: attachment; filename="new_image.jpg"');

(can use 'inline' or 'attachment')

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜