diff --git a/lib/private/Files/Stream/SeekableHttpStream.php b/lib/private/Files/Stream/SeekableHttpStream.php index 820a681bd0748..ef2485dc1efad 100644 --- a/lib/private/Files/Stream/SeekableHttpStream.php +++ b/lib/private/Files/Stream/SeekableHttpStream.php @@ -79,6 +79,7 @@ public static function open(callable $callback) { private $offset = 0; /** @var int */ private $length = 0; + private int $totalSize = 0; private function reconnect(int $start) { $range = $start . '-'; @@ -124,6 +125,9 @@ private function reconnect(int $start) { $this->offset = $begin; $this->length = $length; + if ($start === 0) { + $this->totalSize = $length; + } return true; } @@ -173,7 +177,9 @@ public function stream_tell() { public function stream_stat() { if (is_resource($this->current)) { - return fstat($this->current); + $stat = fstat($this->current); + $stat['size'] = $this->totalSize; + return $stat; } else { return false; }