diff --git a/lib/Controller/AttachmentController.php b/lib/Controller/AttachmentController.php index 44a85aaf110..62a655be39c 100644 --- a/lib/Controller/AttachmentController.php +++ b/lib/Controller/AttachmentController.php @@ -126,7 +126,7 @@ public function insertAttachmentFile(string $filePath): DataResponse { #[NoAdminRequired] #[PublicPage] #[RequireDocumentSession] - public function uploadAttachment(?string $shareToken = null): DataResponse { + public function uploadAttachment(?string $token = null): DataResponse { $documentId = $this->getSession()->getDocumentId(); try { @@ -137,8 +137,8 @@ public function uploadAttachment(?string $shareToken = null): DataResponse { throw new Exception('Could not read file'); } $newFileName = $file['name']; - if ($shareToken) { - $uploadResult = $this->attachmentService->uploadAttachmentPublic($documentId, $newFileName, $newFileResource, $shareToken); + if ($token) { + $uploadResult = $this->attachmentService->uploadAttachmentPublic($documentId, $newFileName, $newFileResource, $token); } else { $userId = $this->getSession()->getUserId(); $uploadResult = $this->attachmentService->uploadAttachment($documentId, $newFileName, $newFileResource, $userId); diff --git a/src/services/SessionApi.js b/src/services/SessionApi.js index 4e596ba5adc..95d97d5ccc9 100644 --- a/src/services/SessionApi.js +++ b/src/services/SessionApi.js @@ -164,7 +164,7 @@ export class Connection { + '?documentId=' + encodeURIComponent(this.#document.id) + '&sessionId=' + encodeURIComponent(this.#session.id) + '&sessionToken=' + encodeURIComponent(this.#session.token) - + '&shareToken=' + encodeURIComponent(this.#options.shareToken || '') + + '&token=' + encodeURIComponent(this.#options.shareToken || '') return this.#post(url, formData, { headers: { 'Content-Type': 'multipart/form-data',