Cleanup temporary files after finishing the write to object storage

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2022-05-30 17:53:07 +02:00 committed by backportbot-nextcloud[bot]
parent 01ae33f4bb
commit 109bbf31db

View file

@ -335,6 +335,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
$handle = fopen($tmpFile, $mode);
return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
$this->writeBack($tmpFile, $path);
unlink($tmpFile);
});
case 'a':
case 'ab':
@ -352,6 +353,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
$handle = fopen($tmpFile, $mode);
return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
$this->writeBack($tmpFile, $path);
unlink($tmpFile);
});
}
return false;