diff --git a/lib/files.php b/lib/files.php index ab7fa1ed096e..abb1617c25ee 100644 --- a/lib/files.php +++ b/lib/files.php @@ -123,8 +123,11 @@ public static function get($dir, $files, $only_header = false) { 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));