fix download Content-Type header (#770)

This commit is contained in:
mclorch 2022-04-11 04:09:51 -04:00 committed by GitHub
parent 13b2bd0164
commit a65f8ff8b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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';