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;
|
$this->params['content'] = $content;
|
||||||
if(null === $this->callHook('version')) {
|
if(null === $this->callHook('version')) {
|
||||||
header("Content-Type: " . $content->getMimeType());
|
if(file_exists($dms->contentDir . $content->getPath())) {
|
||||||
$efilename = rawurlencode($content->getOriginalFileName());
|
header("Content-Type: " . $content->getMimeType());
|
||||||
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);
|
if (!isset($settings->_viewOnlineFileTypes) || !is_array($settings->_viewOnlineFileTypes) || !in_array(strtolower($content->getFileType()), $settings->_viewOnlineFileTypes)) {
|
||||||
} else {
|
header("Content-Disposition: attachment; filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
|
||||||
header("Content-Disposition: filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
|
} else {
|
||||||
}
|
header("Content-Disposition: filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
|
||||||
header("Cache-Control: must-revalidate");
|
}
|
||||||
|
header("Cache-Control: must-revalidate");
|
||||||
|
header("ETag: ".$content->getChecksum());
|
||||||
|
|
||||||
sendFile($dms->contentDir.$content->getPath());
|
sendFile($dms->contentDir.$content->getPath());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user