aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-12-05 15:16:22 +0100
committerRobin Appelman <robin@icewind.nl>2024-12-05 15:16:22 +0100
commit6cf66f95ce9dadffd9fa25203e737917cef0cd8c (patch)
tree7cda4370ec7867cb3441b69932abf9908803a221 /lib
parente4d0882b312923ee9021312c5272df4884276961 (diff)
downloadnextcloud-server-6cf66f95ce9dadffd9fa25203e737917cef0cd8c.tar.gz
nextcloud-server-6cf66f95ce9dadffd9fa25203e737917cef0cd8c.zip
fix: get object size from stream where possible
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/ObjectStore/ObjectStoreStorage.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
index 0963ffbb28f..78eb52a53d9 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -457,6 +457,14 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
}
public function writeStream(string $path, $stream, ?int $size = null): int {
+ if ($size === null) {
+ $stats = fstat($stream);
+ if (is_array($stats) && isset($stats['size'])) {
+ $size = $stats['size'];
+ $this->logger->warning("stream size $size");
+ }
+ }
+
$stat = $this->stat($path);
if (empty($stat)) {
// create new file