From 7d7d5a647f3f94551baca4b2b32cda6bcbb094cd Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Mon, 13 Aug 2012 17:33:03 -0500 Subject: [PATCH] Send attachment content type with downloads --- include/class.file.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/class.file.php b/include/class.file.php index c27c9fdd0..e4012bb4b 100644 --- a/include/class.file.php +++ b/include/class.file.php @@ -108,7 +108,7 @@ class AttachmentFile { function display() { - header('Content-type: '.$this->getType()?$this->getType():'application/octet-stream'); + header('Content-Type: '.($this->getType()?$this->getType():'application/octet-stream')); header('Content-Length: '.$this->getSize()); echo $this->getData(); exit(); @@ -120,9 +120,7 @@ class AttachmentFile { header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: public'); - header('Content-Type: application/octet-stream'); - - //header('Content-Type: '.$this->getType()?$this->getType():'application/octet-stream'); + header('Content-Type: '.($this->getType()?$this->getType():'application/octet-stream')); $filename=basename($this->getName()); $user_agent = strtolower ($_SERVER['HTTP_USER_AGENT']); -- GitLab