mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
fix: get object size from stream where possible
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
48640ce155
commit
eade5703ba
1 changed files with 8 additions and 0 deletions
|
|
@ -474,6 +474,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
|
||||
|
|
|
|||
Loading…
Reference in a new issue