From 7312db03c75588f40d7448ae14a6d7fe284b7c1c Mon Sep 17 00:00:00 2001 From: Malin Lorch Date: Fri, 8 Apr 2022 10:58:21 -0400 Subject: [PATCH] fix download Content-Type header --- tinyfilemanager.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tinyfilemanager.php b/tinyfilemanager.php index 1184536..fd73206 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -3058,9 +3058,14 @@ function fm_download_file($fileLocation, $fileName, $chunkSize = 1024) $extension = pathinfo($fileName, PATHINFO_EXTENSION); $contentType = fm_get_file_mimes($extension); + + if(is_array($contentType)) { + $contentType = implode(' ', $contentType); + } + header("Cache-Control: public"); header("Content-Transfer-Encoding: binary\n"); - header('Content-Type: $contentType'); + header("Content-Type: $contentType"); $contentDisposition = 'attachment';