From 0c6e9acc32a67c501b97e1054cbbce6fe099ca44 Mon Sep 17 00:00:00 2001
From: aydreeihn <adriane@enhancesoft.com>
Date: Wed, 3 Oct 2018 08:43:23 -0500
Subject: [PATCH] File Disposition

This commit ensures that we use the correct disposition for downloading files.
---
 include/class.file.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/class.file.php b/include/class.file.php
index e61b5afe7..5bbd3d885 100644
--- a/include/class.file.php
+++ b/include/class.file.php
@@ -258,7 +258,9 @@ class AttachmentFile extends VerySimpleModel {
         $type = $this->getType() ?: 'application/octet-stream';
         if (isset($_REQUEST['overridetype']))
             $type = $_REQUEST['overridetype'];
-        Http::download($name ?: $this->getName(), $type, null, 'inline');
+        elseif (!strcasecmp($disposition, 'attachment'))
+            $type = 'application/octet-stream';
+        Http::download($name ?: $this->getName(), $type, null, $disposition);
         header('Content-Length: '.$this->getSize());
         $this->sendData(false);
         exit();
-- 
GitLab