We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 399d0d3 commit 5088b97Copy full SHA for 5088b97
1 file changed
lib/private/Files/Stream/SeekableHttpStream.php
@@ -79,6 +79,7 @@ public static function open(callable $callback) {
79
private $offset = 0;
80
/** @var int */
81
private $length = 0;
82
+ private int $totalSize = 0;
83
84
private function reconnect(int $start) {
85
$range = $start . '-';
@@ -124,6 +125,9 @@ private function reconnect(int $start) {
124
125
126
$this->offset = $begin;
127
$this->length = $length;
128
+ if ($start === 0) {
129
+ $this->totalSize = $length;
130
+ }
131
132
return true;
133
}
@@ -173,7 +177,9 @@ public function stream_tell() {
173
177
174
178
public function stream_stat() {
175
179
if (is_resource($this->current)) {
176
- return fstat($this->current);
180
+ $stat = fstat($this->current);
181
+ $stat['size'] = $this->totalSize;
182
+ return $stat;
183
} else {
184
return false;
185
0 commit comments