Chrome Won't Infer File Extension

Add a file extension since the Chrome version I tested didn’t infer the
file extension.
This commit is contained in:
Chip Wasson 2016-08-29 11:22:36 -06:00
parent 745b9cc692
commit 6c1aaeae2a

View File

@ -231,13 +231,13 @@ class http2pic
if ($this->params['type'] === 'png') {
header('Content-Type: image/png');
header('Content-Disposition: inline; filename="'.$this->trimToAlphaNumeric($this->params['url']).'"');
header('Content-Disposition: inline; filename="'.$this->trimToAlphaNumeric($this->params['url']).'.png"');
$result = imagecreatefrompng($this->params['file']);
imagepng($result, NULL, 9);
}
else {
header('Content-Type: image/jpeg');
header('Content-Disposition: inline; filename="'.$this->trimToAlphaNumeric($this->params['url']).'"');
header('Content-Disposition: inline; filename="'.$this->trimToAlphaNumeric($this->params['url']).'.jpg"');
$result = imagecreatefromjpeg($this->params['file']);
imagejpeg($result, NULL, 100);
}