mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
check if content file exists
This commit is contained in:
parent
4d5139fe82
commit
d3294518ad
|
@ -49,16 +49,19 @@ class SeedDMS_Controller_ViewOnline extends SeedDMS_Controller_Common {
|
|||
*/
|
||||
$this->params['content'] = $content;
|
||||
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)) {
|
||||
header("Content-Disposition: attachment; filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
|
||||
} else {
|
||||
header("Content-Disposition: filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
|
||||
}
|
||||
header("Cache-Control: must-revalidate");
|
||||
if(file_exists($dms->contentDir . $content->getPath())) {
|
||||
header("Content-Type: " . $content->getMimeType());
|
||||
$efilename = rawurlencode($content->getOriginalFileName());
|
||||
if (!isset($settings->_viewOnlineFileTypes) || !is_array($settings->_viewOnlineFileTypes) || !in_array(strtolower($content->getFileType()), $settings->_viewOnlineFileTypes)) {
|
||||
header("Content-Disposition: attachment; filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
|
||||
} else {
|
||||
header("Content-Disposition: filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
|
||||
}
|
||||
header("Cache-Control: must-revalidate");
|
||||
header("ETag: ".$content->getChecksum());
|
||||
|
||||
sendFile($dms->contentDir.$content->getPath());
|
||||
sendFile($dms->contentDir.$content->getPath());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user