From 340834bd5333b5e77beed4e2732a0a6adf87bb02 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Fri, 13 Nov 2026 00:58:57 +0000 Subject: [PATCH 1/9] fix(api): detect multipart uploads and reject truncated batches (#9435) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- lib/Controller/FileController.php | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/Controller/FileController.php b/lib/Controller/FileController.php index 4b1ae3c89c..c523464d79 100644 --- a/lib/Controller/FileController.php +++ b/lib/Controller/FileController.php @@ -563,7 +563,11 @@ public function save( try { $this->validateHelper->canRequestSign($this->userSession->getUser()); - $normalizedFiles = $this->prepareFilesForSaving($file, $files, $settings); + $uploadedFiles = $this->request->getUploadedFile('files') ?: $this->request->getUploadedFile('file'); + $normalizedFiles = $this->prepareFilesForSaving($file, $files, $settings, $uploadedFiles); + if ($uploadedFiles) { + $this->assertExpectedUploadedFileCount(count($normalizedFiles)); + } return $this->saveFiles($normalizedFiles, $name, $settings); } catch (LibresignException $e) { @@ -617,6 +621,7 @@ public function addFileToEnvelope(string $uuid): DataResponse { } $normalizedFiles = $this->processUploadedFiles($uploadedFiles); + $this->assertExpectedUploadedFileCount(count($normalizedFiles)); $addedFiles = []; foreach ($normalizedFiles as $fileData) { @@ -705,9 +710,7 @@ private function prepareFileForSaving(array $fileData, string $name, array $sett /** * @return list Normalized files array */ - private function prepareFilesForSaving(array $file, array $files, array $settings): array { - $uploadedFiles = $this->request->getUploadedFile('files') ?: $this->request->getUploadedFile('file'); - + private function prepareFilesForSaving(array $file, array $files, array $settings, ?array $uploadedFiles): array { if ($uploadedFiles) { return $this->processUploadedFiles($uploadedFiles); } @@ -724,6 +727,24 @@ private function prepareFilesForSaving(array $file, array $files, array $setting throw new LibresignException($this->l10n->t('File or files parameter is required')); } + /** + * Detect uploads silently truncated by PHP's max_file_uploads limit. + * Clients may omit the count for backwards compatibility. + */ + private function assertExpectedUploadedFileCount(int $receivedCount): void { + $declaredCount = $this->request->getParam('expectedFilesCount'); + if ($declaredCount === null) { + return; + } + if ((!is_string($declaredCount) && !is_int($declaredCount)) + || !ctype_digit((string)$declaredCount) + || (string)(int)$declaredCount !== (string)$declaredCount + || (int)$declaredCount !== $receivedCount) { + // TRANSLATORS Error shown when the number of uploaded documents differs from the count declared by the client. + throw new LibresignException($this->l10n->t('The number of uploaded files does not match the expected count')); + } + } + /** * @return list */ From 00a469e6ff416caeb9dc33325d866b97e92db419 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:00:15 +0000 Subject: [PATCH 2/9] test(ui): verify multipart upload count propagation (#9435) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- src/components/Request/RequestPicker.vue | 1 + .../RightSidebar/EnvelopeFilesList.vue | 1 + .../components/Request/RequestPicker.spec.ts | 3 + .../FileControllerUploadCountTest.php | 63 +++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 tests/php/Unit/Controller/FileControllerUploadCountTest.php diff --git a/src/components/Request/RequestPicker.vue b/src/components/Request/RequestPicker.vue index 90cadbaa4d..99b28d5b64 100644 --- a/src/components/Request/RequestPicker.vue +++ b/src/components/Request/RequestPicker.vue @@ -325,6 +325,7 @@ async function upload(files: UploadFile[], selectedEnvelopeName: string | null = uploadStartTime.value = Date.now() const formData = new FormData() + formData.append('expectedFilesCount', String(files.length)) if (files.length === 1) { const name = files[0].name.replace(/\.pdf$/i, '') diff --git a/src/components/RightSidebar/EnvelopeFilesList.vue b/src/components/RightSidebar/EnvelopeFilesList.vue index dac9a3f02f..4f7ea5ac92 100644 --- a/src/components/RightSidebar/EnvelopeFilesList.vue +++ b/src/components/RightSidebar/EnvelopeFilesList.vue @@ -509,6 +509,7 @@ function addFileToEnvelope() { uploadStartTime.value = Date.now() const formData = new FormData() + formData.append('expectedFilesCount', String(selectedFileList.length)) let aggregateSize = 0 for (const file of selectedFileList) { diff --git a/src/tests/components/Request/RequestPicker.spec.ts b/src/tests/components/Request/RequestPicker.spec.ts index 6e4e2067f2..10e7724f1b 100644 --- a/src/tests/components/Request/RequestPicker.spec.ts +++ b/src/tests/components/Request/RequestPicker.spec.ts @@ -599,6 +599,7 @@ describe('RequestPicker component rules', () => { expect(filesStore.upload).toHaveBeenCalled() const [formData] = filesStore.upload.mock.calls[0] as [FormData, { onUploadProgress?: (event: { loaded: number; total: number }) => void } | undefined] expect(formData.get('name')).toBe('document') + expect(formData.get('expectedFilesCount')).toBe('1') }) it('sets upload progress when receiving upload events', async () => { @@ -665,6 +666,8 @@ describe('RequestPicker component rules', () => { expect(filesStore.upload).toHaveBeenCalled() const [formData] = filesStore.upload.mock.calls[0] as [FormData, { onUploadProgress?: (event: { loaded: number; total: number }) => void } | undefined] expect(formData.get('name')).toBe('My Envelope') + expect(formData.get('expectedFilesCount')).toBe('2') + expect(formData.getAll('files[]')).toHaveLength(2) }) it('trims envelope name before upload', async () => { diff --git a/tests/php/Unit/Controller/FileControllerUploadCountTest.php b/tests/php/Unit/Controller/FileControllerUploadCountTest.php new file mode 100644 index 0000000000..95260a8ecf --- /dev/null +++ b/tests/php/Unit/Controller/FileControllerUploadCountTest.php @@ -0,0 +1,63 @@ + [null, 2, true], + 'single upload' => ['1', 1, true], + 'two uploads' => ['2', 2, true], + 'integer form value' => [2, 2, true], + 'truncated upload' => ['2', 1, false], + 'unexpected extra file' => ['1', 2, false], + 'invalid string' => ['abc', 2, false], + 'invalid array' => [['2'], 2, false], + 'zero files declared' => ['0', 2, false], + 'leading zero' => ['02', 2, false], + 'integer overflow' => ['999999999999999999999999', 2, false], + ]; + } + + #[DataProvider('uploadCountProvider')] + public function testExpectedUploadCount(mixed $declaredCount, int $receivedCount, bool $accepted): void { + $request = $this->createMock(IRequest::class); + $request->expects($this->once()) + ->method('getParam') + ->with('expectedFilesCount') + ->willReturn($declaredCount); + + $l10n = $this->createMock(IL10N::class); + $l10n->method('t')->willReturnCallback(static fn (string $message): string => $message); + + $reflection = new ReflectionClass(FileController::class); + /** @var FileController $controller */ + $controller = $reflection->newInstanceWithoutConstructor(); + $reflection->getProperty('request')->setValue($controller, $request); + $reflection->getProperty('l10n')->setValue($controller, $l10n); + + if (!$accepted) { + $this->expectException(LibresignException::class); + $this->expectExceptionMessage('The number of uploaded files does not match the expected count'); + } + + (new ReflectionMethod(FileController::class, 'assertExpectedUploadedFileCount')) + ->invoke($controller, $receivedCount); + } +} From 33155b9d5b8c19082822f1e8e09e22f5186524ab Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:01:18 +0000 Subject: [PATCH 3/9] test(ui): cover envelope multipart file count (#9435) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- .../RightSidebar/EnvelopeFilesList.spec.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/tests/components/RightSidebar/EnvelopeFilesList.spec.ts b/src/tests/components/RightSidebar/EnvelopeFilesList.spec.ts index c817890321..77dd10a160 100644 --- a/src/tests/components/RightSidebar/EnvelopeFilesList.spec.ts +++ b/src/tests/components/RightSidebar/EnvelopeFilesList.spec.ts @@ -79,6 +79,7 @@ type EnvelopeFilesListVm = { isTouchDevice: boolean getMaxFileUploads: () => number validateMaxFileUploads: (filesCount: number) => boolean + addFileToEnvelope: () => void getPreviewUrl: (file: Partial) => string | null openFile: (file: EnvelopeFileRecord) => void isSelected: (fileId: number) => boolean @@ -363,6 +364,33 @@ describe('EnvelopeFilesList', () => { }) }) + describe('RULE: multipart envelope upload', () => { + it('sends two files with matching declared count', async () => { + filesStore.selectedFile = { id: 1, uuid: 'envelope-uuid', status: FILE_STATUS.DRAFT } + wrapper = createWrapper() + vi.mocked(axios.post).mockResolvedValue({ + data: { ocs: { data: { files: [], filesCount: 2, message: 'Files added' } } }, + }) + const createElementSpy = vi.spyOn(document, 'createElement') + wrapper.vm.addFileToEnvelope() + const input = createElementSpy.mock.results + .find(result => result.value?.type === 'file')?.value as HTMLInputElement + expect(input).toBeDefined() + Object.defineProperty(input, 'files', { + value: [ + new File(['a'], 'one.pdf', { type: 'application/pdf' }), + new File(['b'], 'two.pdf', { type: 'application/pdf' }), + ], + configurable: true, + }) + await input.onchange?.({ target: input } as unknown as Event) + const multipart = vi.mocked(axios.post).mock.calls[0][1] as FormData + expect(multipart.get('expectedFilesCount')).toBe('2') + expect(multipart.getAll('files[]')).toHaveLength(2) + createElementSpy.mockRestore() + }) + }) + describe('RULE: getPreviewUrl constructs thumbnail URL with parameters', () => { it('prefers file id URLs and appends preview parameters', () => { wrapper = createWrapper() From 897908442dbe7a6ebed86c18cb36fb95000c92c7 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:02:21 +0000 Subject: [PATCH 4/9] style(test): follow PHP test indentation conventions (#9435) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- .../FileControllerUploadCountTest.php | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/tests/php/Unit/Controller/FileControllerUploadCountTest.php b/tests/php/Unit/Controller/FileControllerUploadCountTest.php index 95260a8ecf..ba4d1b1bdd 100644 --- a/tests/php/Unit/Controller/FileControllerUploadCountTest.php +++ b/tests/php/Unit/Controller/FileControllerUploadCountTest.php @@ -19,45 +19,45 @@ use ReflectionMethod; final class FileControllerUploadCountTest extends TestCase { - public static function uploadCountProvider(): array { - return [ - 'legacy request without count' => [null, 2, true], - 'single upload' => ['1', 1, true], - 'two uploads' => ['2', 2, true], - 'integer form value' => [2, 2, true], - 'truncated upload' => ['2', 1, false], - 'unexpected extra file' => ['1', 2, false], - 'invalid string' => ['abc', 2, false], - 'invalid array' => [['2'], 2, false], - 'zero files declared' => ['0', 2, false], - 'leading zero' => ['02', 2, false], - 'integer overflow' => ['999999999999999999999999', 2, false], - ]; - } - - #[DataProvider('uploadCountProvider')] - public function testExpectedUploadCount(mixed $declaredCount, int $receivedCount, bool $accepted): void { - $request = $this->createMock(IRequest::class); - $request->expects($this->once()) - ->method('getParam') - ->with('expectedFilesCount') - ->willReturn($declaredCount); - - $l10n = $this->createMock(IL10N::class); - $l10n->method('t')->willReturnCallback(static fn (string $message): string => $message); - - $reflection = new ReflectionClass(FileController::class); - /** @var FileController $controller */ - $controller = $reflection->newInstanceWithoutConstructor(); - $reflection->getProperty('request')->setValue($controller, $request); - $reflection->getProperty('l10n')->setValue($controller, $l10n); - - if (!$accepted) { - $this->expectException(LibresignException::class); - $this->expectExceptionMessage('The number of uploaded files does not match the expected count'); - } - - (new ReflectionMethod(FileController::class, 'assertExpectedUploadedFileCount')) - ->invoke($controller, $receivedCount); - } + public static function uploadCountProvider(): array { + return [ + 'legacy request without count' => [null, 2, true], + 'single upload' => ['1', 1, true], + 'two uploads' => ['2', 2, true], + 'integer form value' => [2, 2, true], + 'truncated upload' => ['2', 1, false], + 'unexpected extra file' => ['1', 2, false], + 'invalid string' => ['abc', 2, false], + 'invalid array' => [['2'], 2, false], + 'zero files declared' => ['0', 2, false], + 'leading zero' => ['02', 2, false], + 'integer overflow' => ['999999999999999999999999', 2, false], + ]; + } + + #[DataProvider('uploadCountProvider')] + public function testExpectedUploadCount(mixed $declaredCount, int $receivedCount, bool $accepted): void { + $request = $this->createMock(IRequest::class); + $request->expects($this->once()) + ->method('getParam') + ->with('expectedFilesCount') + ->willReturn($declaredCount); + + $l10n = $this->createMock(IL10N::class); + $l10n->method('t')->willReturnCallback(static fn (string $message): string => $message); + + $reflection = new ReflectionClass(FileController::class); + /** @var FileController $controller */ + $controller = $reflection->newInstanceWithoutConstructor(); + $reflection->getProperty('request')->setValue($controller, $request); + $reflection->getProperty('l10n')->setValue($controller, $l10n); + + if (!$accepted) { + $this->expectException(LibresignException::class); + $this->expectExceptionMessage('The number of uploaded files does not match the expected count'); + } + + (new ReflectionMethod(FileController::class, 'assertExpectedUploadedFileCount')) + ->invoke($controller, $receivedCount); + } } From baf12dd58daa0827ca12c3b055c996a0aaa049d6 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:03:04 +0000 Subject: [PATCH 5/9] docs(api): describe optional multipart upload count (#9435) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- lib/Controller/FileController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Controller/FileController.php b/lib/Controller/FileController.php index c523464d79..2be5692f9a 100644 --- a/lib/Controller/FileController.php +++ b/lib/Controller/FileController.php @@ -535,6 +535,7 @@ private function getMimeFallbackResponse(string $mimeType): ?\OCP\AppFramework\H * * Send a new file to Nextcloud and return the fileId to request signature. * Files must be uploaded as multipart/form-data with field name 'file[]' or 'files[]'. + * Multipart clients can send optional expectedFilesCount to reject incomplete batches. * * **Note on multiple file uploads:** * PHP has a limit on the number of files that can be uploaded in a single request (max_file_uploads directive, default 20). @@ -585,6 +586,7 @@ public function save( * * Add one or more files to an existing envelope that is in DRAFT status. * Files must be uploaded as multipart/form-data with field name 'files[]'. + * Multipart clients can send optional expectedFilesCount to reject incomplete batches. * * @param string $uuid The UUID of the envelope * @return DataResponse|DataResponse From b597b3aefc7d211aa1096cace0fe60eff48d4819 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Fri, 13 Nov 2026 12:16:46 +0000 Subject: [PATCH 6/9] test(ui): provide envelope capabilities for multipart scenario (#9435) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- .../components/RightSidebar/EnvelopeFilesList.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tests/components/RightSidebar/EnvelopeFilesList.spec.ts b/src/tests/components/RightSidebar/EnvelopeFilesList.spec.ts index 77dd10a160..b858b286eb 100644 --- a/src/tests/components/RightSidebar/EnvelopeFilesList.spec.ts +++ b/src/tests/components/RightSidebar/EnvelopeFilesList.spec.ts @@ -366,6 +366,14 @@ describe('EnvelopeFilesList', () => { describe('RULE: multipart envelope upload', () => { it('sends two files with matching declared count', async () => { + getCapabilitiesMock.mockReturnValue({ + libresign: { + config: { + envelope: { 'is-available': true }, + upload: { 'max-file-uploads': 20 }, + }, + }, + }) filesStore.selectedFile = { id: 1, uuid: 'envelope-uuid', status: FILE_STATUS.DRAFT } wrapper = createWrapper() vi.mocked(axios.post).mockResolvedValue({ From 4fab84d90eab95fdc532d5945e8a03eae1605ab4 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Fri, 13 Nov 2026 12:17:24 +0000 Subject: [PATCH 7/9] chore(openapi): synchronize generated upload descriptions (#9435) chore(openapi): synchronize generated upload descriptions (#9435) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> [skip ci] --- openapi-full.json | 2 +- openapi.json | 2 +- src/types/openapi/openapi-full.ts | 2 +- src/types/openapi/openapi.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openapi-full.json b/openapi-full.json index 2eed31a212..d32a3e9c3a 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -5543,7 +5543,7 @@ "post": { "operationId": "file-add-file-to-envelope", "summary": "Add file to envelope", - "description": "Add one or more files to an existing envelope that is in DRAFT status. Files must be uploaded as multipart/form-data with field name 'files[]'.", + "description": "Add one or more files to an existing envelope that is in DRAFT status. Files must be uploaded as multipart/form-data with field name 'files[]'. Multipart clients can send optional expectedFilesCount to reject incomplete batches.", "tags": [ "file" ], diff --git a/openapi.json b/openapi.json index 0c2ba9e398..2b1db20cdd 100644 --- a/openapi.json +++ b/openapi.json @@ -4915,7 +4915,7 @@ "post": { "operationId": "file-add-file-to-envelope", "summary": "Add file to envelope", - "description": "Add one or more files to an existing envelope that is in DRAFT status. Files must be uploaded as multipart/form-data with field name 'files[]'.", + "description": "Add one or more files to an existing envelope that is in DRAFT status. Files must be uploaded as multipart/form-data with field name 'files[]'. Multipart clients can send optional expectedFilesCount to reject incomplete batches.", "tags": [ "file" ], diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index 520154e472..954b6ad455 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -325,7 +325,7 @@ export type paths = { put?: never; /** * Add file to envelope - * @description Add one or more files to an existing envelope that is in DRAFT status. Files must be uploaded as multipart/form-data with field name 'files[]'. + * @description Add one or more files to an existing envelope that is in DRAFT status. Files must be uploaded as multipart/form-data with field name 'files[]'. Multipart clients can send optional expectedFilesCount to reject incomplete batches. */ post: operations["file-add-file-to-envelope"]; delete?: never; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index b1ac8da705..075d5defba 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -325,7 +325,7 @@ export type paths = { put?: never; /** * Add file to envelope - * @description Add one or more files to an existing envelope that is in DRAFT status. Files must be uploaded as multipart/form-data with field name 'files[]'. + * @description Add one or more files to an existing envelope that is in DRAFT status. Files must be uploaded as multipart/form-data with field name 'files[]'. Multipart clients can send optional expectedFilesCount to reject incomplete batches. */ post: operations["file-add-file-to-envelope"]; delete?: never; From c93327c326735966611efcaf8331cb5f982ba11a Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Sat, 14 Nov 2026 18:23:07 +0000 Subject: [PATCH 8/9] test(api): reject negative and padded multipart counts on stable34 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- tests/php/Unit/Controller/FileControllerUploadCountTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/php/Unit/Controller/FileControllerUploadCountTest.php b/tests/php/Unit/Controller/FileControllerUploadCountTest.php index ba4d1b1bdd..6ed03dced4 100644 --- a/tests/php/Unit/Controller/FileControllerUploadCountTest.php +++ b/tests/php/Unit/Controller/FileControllerUploadCountTest.php @@ -32,6 +32,8 @@ public static function uploadCountProvider(): array { 'zero files declared' => ['0', 2, false], 'leading zero' => ['02', 2, false], 'integer overflow' => ['999999999999999999999999', 2, false], + 'negative count' => ['-1', 2, false], + 'count with spaces' => [' 2 ', 2, false], ]; } From c5d8799b88b2d12c6121aa885ac4f4ac3ac2fc95 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Sat, 14 Nov 2026 18:35:56 +0000 Subject: [PATCH 9/9] chore(openapi): synchronize generated multipart upload docs on stable34 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- openapi-full.json | 2 +- openapi.json | 2 +- src/types/openapi/openapi-full.ts | 2 +- src/types/openapi/openapi.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openapi-full.json b/openapi-full.json index d32a3e9c3a..05a42f5e29 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -5404,7 +5404,7 @@ "post": { "operationId": "file-save", "summary": "Send a file", - "description": "Send a new file to Nextcloud and return the fileId to request signature. Files must be uploaded as multipart/form-data with field name 'file[]' or 'files[]'.\n**Note on multiple file uploads:** PHP has a limit on the number of files that can be uploaded in a single request (max_file_uploads directive, default 20). When uploading many files (more than 20), consider uploading them sequentially in multiple requests or use individual file uploads like the Files app does.", + "description": "Send a new file to Nextcloud and return the fileId to request signature. Files must be uploaded as multipart/form-data with field name 'file[]' or 'files[]'. Multipart clients can send optional expectedFilesCount to reject incomplete batches.\n**Note on multiple file uploads:** PHP has a limit on the number of files that can be uploaded in a single request (max_file_uploads directive, default 20). When uploading many files (more than 20), consider uploading them sequentially in multiple requests or use individual file uploads like the Files app does.", "tags": [ "file" ], diff --git a/openapi.json b/openapi.json index 2b1db20cdd..aab54bb2dc 100644 --- a/openapi.json +++ b/openapi.json @@ -4776,7 +4776,7 @@ "post": { "operationId": "file-save", "summary": "Send a file", - "description": "Send a new file to Nextcloud and return the fileId to request signature. Files must be uploaded as multipart/form-data with field name 'file[]' or 'files[]'.\n**Note on multiple file uploads:** PHP has a limit on the number of files that can be uploaded in a single request (max_file_uploads directive, default 20). When uploading many files (more than 20), consider uploading them sequentially in multiple requests or use individual file uploads like the Files app does.", + "description": "Send a new file to Nextcloud and return the fileId to request signature. Files must be uploaded as multipart/form-data with field name 'file[]' or 'files[]'. Multipart clients can send optional expectedFilesCount to reject incomplete batches.\n**Note on multiple file uploads:** PHP has a limit on the number of files that can be uploaded in a single request (max_file_uploads directive, default 20). When uploading many files (more than 20), consider uploading them sequentially in multiple requests or use individual file uploads like the Files app does.", "tags": [ "file" ], diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index 954b6ad455..6dd4582b7c 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -304,7 +304,7 @@ export type paths = { put?: never; /** * Send a file - * @description Send a new file to Nextcloud and return the fileId to request signature. Files must be uploaded as multipart/form-data with field name 'file[]' or 'files[]'. + * @description Send a new file to Nextcloud and return the fileId to request signature. Files must be uploaded as multipart/form-data with field name 'file[]' or 'files[]'. Multipart clients can send optional expectedFilesCount to reject incomplete batches. * **Note on multiple file uploads:** PHP has a limit on the number of files that can be uploaded in a single request (max_file_uploads directive, default 20). When uploading many files (more than 20), consider uploading them sequentially in multiple requests or use individual file uploads like the Files app does. */ post: operations["file-save"]; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 075d5defba..64668e48c8 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -304,7 +304,7 @@ export type paths = { put?: never; /** * Send a file - * @description Send a new file to Nextcloud and return the fileId to request signature. Files must be uploaded as multipart/form-data with field name 'file[]' or 'files[]'. + * @description Send a new file to Nextcloud and return the fileId to request signature. Files must be uploaded as multipart/form-data with field name 'file[]' or 'files[]'. Multipart clients can send optional expectedFilesCount to reject incomplete batches. * **Note on multiple file uploads:** PHP has a limit on the number of files that can be uploaded in a single request (max_file_uploads directive, default 20). When uploading many files (more than 20), consider uploading them sequentially in multiple requests or use individual file uploads like the Files app does. */ post: operations["file-save"];