diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index ad7bede15da02..91113f6226c26 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -493,6 +493,9 @@ public function writeStream(string $path, $stream, int $size = null): int { $stat['size'] = $size; } else { $this->objectStore->writeObject($urn, $stream); + if (is_resource($stream)) { + fclose($stream); + } } } catch (\Exception $ex) { if (!$exists) {