Content-Length is now set in sendFile()

This commit is contained in:
Uwe Steinmann 2020-12-23 06:21:24 +01:00
parent 3b0eafd5aa
commit 8b2e8e0c0d
3 changed files with 0 additions and 3 deletions

View File

@ -54,7 +54,6 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common {
if(null === $this->callHook('version')) { if(null === $this->callHook('version')) {
if(file_exists($dms->contentDir . $content->getPath())) { if(file_exists($dms->contentDir . $content->getPath())) {
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($dms->contentDir . $content->getPath() ));
$efilename = rawurlencode($content->getOriginalFileName()); $efilename = rawurlencode($content->getOriginalFileName());
header("Content-Disposition: attachment; filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename); header("Content-Disposition: attachment; filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
header("Content-Type: " . $content->getMimeType()); header("Content-Type: " . $content->getMimeType());

View File

@ -41,7 +41,6 @@ class SeedDMS_Controller_ExtensionMgr extends SeedDMS_Controller_Common {
if(null === $this->callHook('download')) { if(null === $this->callHook('download')) {
if(file_exists($filename)) { if(file_exists($filename)) {
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filename));
header("Content-Disposition: attachment; filename=\"" . utf8_basename($filename) . "\"; filename*=UTF-8''".utf8_basename($filename)); header("Content-Disposition: attachment; filename=\"" . utf8_basename($filename) . "\"; filename*=UTF-8''".utf8_basename($filename));
header("Content-Type: application/zip"); header("Content-Type: application/zip");
header("Cache-Control: must-revalidate"); header("Cache-Control: must-revalidate");

View File

@ -56,7 +56,6 @@ class SeedDMS_Controller_ViewOnline extends SeedDMS_Controller_Common {
} else { } else {
header("Content-Disposition: filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename); header("Content-Disposition: filename=\"" . $efilename . "\"; filename*=UTF-8''".$efilename);
} }
header("Content-Length: " . filesize($dms->contentDir . $content->getPath()));
header("Cache-Control: must-revalidate"); header("Cache-Control: must-revalidate");
sendFile($dms->contentDir.$content->getPath()); sendFile($dms->contentDir.$content->getPath());