note 56240 deleted from function.imagejpeg by cmb
| From: | cmb@php.net | Date: | Sun, 20 Oct 2019 08:57:12 +0000 |
| Subject: | note 56240 deleted from function.imagejpeg by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212716@lists.php.net to get a copy of this message | ||
Note Submitter: (enVide neFelibata) envide at tugamail dot com
----
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.