summaryrefslogtreecommitdiffstats
path: root/system/libraries/Image_lib.php
diff options
context:
space:
mode:
authorMehdi Bounya <5004111+mehdibo@users.noreply.github.com>2018-01-31 05:43:37 +0100
committerGitHub <noreply@github.com>2018-01-31 05:43:37 +0100
commit2ad0b3553121ea2e5951179ac0aaca8fc71b767b (patch)
treed31b7c4ce884e1f27e42d899188c4bbf37942e40 /system/libraries/Image_lib.php
parent6545f8595480ab64220aacc8a5176383dac4122b (diff)
File name changing in dynamic output
Allow changing file name (`Content-Disposition` header) when outputting the image by specifying the `new_name` config
Diffstat (limited to 'system/libraries/Image_lib.php')
-rw-r--r--system/libraries/Image_lib.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index 63e071e7c..f7b66c72e 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -1548,7 +1548,7 @@ class CI_Image_lib {
*/
public function image_display_gd($resource)
{
- header('Content-Disposition: filename='.$this->source_image.';');
+ header('Content-Disposition: filename='.( (empty($this->new_image)) ? $this->source_image : $this->new_image ).';');
header('Content-Type: '.$this->mime_type);
header('Content-Transfer-Encoding: binary');
header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');