mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
do not add extension if it already exists (getDocumentContent())
This commit is contained in:
parent
83aa6fe02e
commit
041c7934bc
|
@ -539,8 +539,14 @@ function getDocumentContent($id) { /* {{{ */
|
|||
if($document) {
|
||||
if ($document->getAccessMode($userobj) >= M_READ) {
|
||||
$lc = $document->getLatestContent();
|
||||
|
||||
if (pathinfo($document->getName(), PATHINFO_EXTENSION) == $lc->getFileType())
|
||||
$filename = $document->getName();
|
||||
else
|
||||
$filename = $document->getName().$lc->getFileType();
|
||||
|
||||
$app->response()->header('Content-Type', $lc->getMimeType());
|
||||
$app->response()->header("Content-Disposition: filename=\"" . $document->getName().$lc->getFileType() . "\"");
|
||||
$app->response()->header("Content-Disposition: filename=\"" . $filename . "\"");
|
||||
$app->response()->header("Content-Length", filesize($dms->contentDir . $lc->getPath()));
|
||||
$app->response()->header("Expires", "0");
|
||||
$app->response()->header("Cache-Control", "no-cache, must-revalidate");
|
||||
|
|
Loading…
Reference in New Issue
Block a user