diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index e63fec9aa4..4028bd3580 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -656,7 +656,13 @@ public function postFile(string $fileId, string $access_token): JSONResponse { // create a unique new file $path = $this->rootFolder->getNonExistingName($path); - $file = $file->move($path); + $this->lockManager->runInScope(new LockContext( + $this->getFileForWopiToken($wopi), + ILock::TYPE_APP, + Application::APPNAME + ), function () use (&$file, $path) { + $file = $file->move($path); + }); } else { $file = $this->getFileForWopiToken($wopi);