set Content-Disposition even if file type not in list of online file types

This commit is contained in:
Uwe Steinmann 2017-01-10 08:45:21 +01:00
parent 8375b66cbe
commit 05f1919e3c

View File

@ -33,8 +33,10 @@ class SeedDMS_Controller_ViewOnline extends SeedDMS_Controller_Common {
case "version":
if(null === $this->callHook('version')) {
header("Content-Type: " . $content->getMimeType());
$efilename = rawurlencode($content->getOriginalFileName());
if (!isset($settings->_viewOnlineFileTypes) || !is_array($settings->_viewOnlineFileTypes) || !in_array(strtolower($content->getFileType()), $settings->_viewOnlineFileTypes)) {
$efilename = rawurlencode($content->getOriginalFileName());
header("Content-Disposition: attachment; filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
} else {
header("Content-Disposition: filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
}
header("Content-Length: " . filesize($dms->contentDir . $content->getPath()));