Don't set Content-Length header if size is unknown
This commit is contained in:
parent
0f314c1404
commit
9bebf9b4c8
1 changed files with 4 additions and 1 deletions
|
@ -123,8 +123,11 @@ class OC_Files {
|
|||
header('Content-Length: ' . filesize($filename));
|
||||
self::addSendfileHeader($filename);
|
||||
}else{
|
||||
$filesize = \OC\Files\Filesystem::filesize($filename);
|
||||
header('Content-Type: '.\OC\Files\Filesystem::getMimeType($filename));
|
||||
header("Content-Length: ".\OC\Files\Filesystem::filesize($filename));
|
||||
if ($filesize > -1) {
|
||||
header("Content-Length: ".$filesize);
|
||||
}
|
||||
list($storage) = \OC\Files\Filesystem::resolvePath($filename);
|
||||
if ($storage instanceof \OC\Files\Storage\Local) {
|
||||
self::addSendfileHeader(\OC\Files\Filesystem::getLocalFile($filename));
|
||||
|
|
Loading…
Reference in a new issue