Download filename fix

This commit is contained in:
Milos Stojanovic 2020-03-08 10:27:02 +01:00
parent 5a5bd01e55
commit f49f6bb00b

View File

@ -65,11 +65,11 @@ class DownloadController
// @codeCoverageIgnoreEnd
});
$contentDisposition = HeaderUtils::DISPOSITION_ATTACHMENT;
$contentDisposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $file['filename'], 'file');
$contentType = 'application/octet-stream';
if (pathinfo($file['filename'], PATHINFO_EXTENSION) == 'pdf') {
$contentDisposition = HeaderUtils::DISPOSITION_INLINE;
$contentDisposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_INLINE, $file['filename'], 'file');
$contentType = 'application/pdf';
}