Skip to content

Commit 3cbc98e

Browse files
committed
Implement the size of an assembly stream
This will make it possible to act propely on moves of future files if we need to know the size (like for max size virus scanning). Signed-off-by: Roeland Jago Douma <[email protected]>
1 parent 410bd9d commit 3cbc98e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/dav/lib/Upload/AssemblyStream.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ public function stream_truncate($size) {
170170
* @return array
171171
*/
172172
public function stream_stat() {
173-
return [];
173+
$size = array_reduce($this->nodes, function(int $size, IFile $node) {
174+
return $size + $node->getSize();
175+
}, 0);
176+
177+
return [
178+
'size' => $size,
179+
];
174180
}
175181

176182
/**

0 commit comments

Comments
 (0)