note 56240 added to function.imagejpeg
| From: | (enVideneFelibata) | Date: | Sun, 28 Aug 2005 14:32:17 +0000 |
| Subject: | note 56240 added to function.imagejpeg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94293@lists.php.net to get a copy of this message | ||
Every script I was writing was giving me an error.
When writing the following code I was able, as a client, to browse the website and save the images
(Save image as...) with IE. Yet with Firefox and family the browser tried to save them as
'script_name.php' instead of 'image_name.jpg'.
<?php
header("Content-Type: image/jpeg");
imagejpeg($image,'',100); // Output to Browser
?>
After trying to save all the watermarked images or saving the image as 'temp.jpg' before
outputing it to user, I've read this topic on BugZilla that advised to add the following
header:
<?php
header("Content-Type: image/jpeg");
header("Content-Disposition: attachment; filename=image_name.jpg"); // THIS ONE
?>
Sorry about the English.
----
Manual Page -- http://www.php.net/manual/en/function.imagejpeg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56240
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56240&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56240&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56240&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56240&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56240&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56240&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56240&report=yes
Search -- http://master.php.net/manage/user-notes.php