diff options
author | Robin Appelman <robin@icewind.nl> | 2024-12-05 15:16:22 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-12-05 15:16:22 +0100 |
commit | 6cf66f95ce9dadffd9fa25203e737917cef0cd8c (patch) | |
tree | 7cda4370ec7867cb3441b69932abf9908803a221 /lib | |
parent | e4d0882b312923ee9021312c5272df4884276961 (diff) | |
download | nextcloud-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.php | 8 |
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 |