From a65f8ff8b5c5ab644a0d5ad0e8d7aa79d50c2a6f Mon Sep 17 00:00:00 2001 From: mclorch <68969684+mclorch@users.noreply.github.com> Date: Mon, 11 Apr 2022 04:09:51 -0400 Subject: [PATCH] fix download Content-Type header (#770) --- 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';