diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index a3546b1ca9..f4a84bf2cb 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -652,7 +652,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);