diff --git a/lib/Controller/AttachmentController.php b/lib/Controller/AttachmentController.php index 44a85aaf110..486f9b3f9e9 100644 --- a/lib/Controller/AttachmentController.php +++ b/lib/Controller/AttachmentController.php @@ -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',