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