diff --git a/lib/private/Files/Stream/SeekableHttpStream.php b/lib/private/Files/Stream/SeekableHttpStream.php index df37fd29f42b8..e53c20b5900ae 100644 --- a/lib/private/Files/Stream/SeekableHttpStream.php +++ b/lib/private/Files/Stream/SeekableHttpStream.php @@ -78,6 +78,7 @@ public static function open(callable $callback) { private int $offset = 0; private int $length = 0; private bool $needReconnect = false; + private int $totalSize = 0; private function reconnect(int $start): bool { $this->needReconnect = false; @@ -128,6 +129,9 @@ private function reconnect(int $start): bool { $this->offset = $begin; $this->length = $length; + if ($start === 0) { + $this->totalSize = $length; + } return true; } @@ -211,7 +215,9 @@ public function stream_tell() { public function stream_stat() { if ($this->getCurrent()) { - return fstat($this->getCurrent()); + $stat = fstat($this->getCurrent()); + $stat['size'] = $this->totalSize; + return $stat; } else { return false; }