Cleanup temporary files after finishing the write to object storage

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/32662/head
Julius Härtl 3 years ago committed by Julius Härtl (Rebase PR Action)
parent ca45e6a064
commit 0f0e74a78c
  1. 2
      lib/private/Files/ObjectStore/ObjectStoreStorage.php

@ -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;

Loading…
Cancel
Save