Skip to content

Feat(file): add support of the chunked file upload - #3661

Draft
Koc wants to merge 2 commits into
mainfrom
feature/chunked-file-upload
Draft

Koc wants to merge 2 commits into
mainfrom
feature/chunked-file-upload

Conversation

@Koc

@Koc Koc commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

🚧 WIP

Closes #3449.

What changed

File question uploads previously used a single multipart POST request per
selection. Files were limited by PHP upload limits and could not be resumed.

Uploads now go through a temporary public upload share and the standard
Nextcloud WebDAV endpoint, the same mechanism used by the Files app:

  1. POST .../submissions/files/{questionId}/share creates a temporary folder
    in the form owner's storage and shares it via a create-only (file drop)
    public link.
  2. The file is uploaded over public.php/dav using the uploader from
    @nextcloud/files (MKCOL workspace, parallel chunk PUTs, MOVE assemble).
    Chunking requires the dav.public_shares_chunking capability; smaller
    files are sent as a plain PUT.
  3. POST .../submissions/files/{questionId}/register binds the uploaded file
    to the form and question and returns uploadedFileId + uploadToken,
    which are submitted as the answer exactly as before.

Behavior changes

  • Large files are uploaded in chunks with parallel requests and show
    per-file progress instead of a single "Uploading …" indicator.
  • Uploads can be cancelled per file.
  • Works for public (anonymous) submissions, since files are uploaded through
    a public share owned by the form owner.
  • If the share or WebDAV upload fails, the client falls back to the previous
    multipart endpoint, so instances with disabled/restricted link shares keep
    working.
  • Stale upload shares and folders are removed by the existing
    CleanupUploadedFilesJob.

API

Two new endpoints (see docs/API_v3.md / openapi.json):

  • POST /api/v3/forms/{formId}/submissions/files/{questionId}/share
  • POST /api/v3/forms/{formId}/submissions/files/{questionId}/register

The existing POST .../files/{questionId} multipart endpoint is unchanged
and remains supported.

Dependencies

  • @nextcloud/files ^4.1.0-beta.2 (new uploader, public chunking support)
  • @nextcloud/vue ^9.12.0

How to test

  1. Create a form with a file question and open it as a logged-in user and
    via a public share link.
  2. Upload a small file and a large file (> chunk size) and verify progress
    is shown and the submission succeeds.
  3. Upload two files with the same name (conflict rename) and cancel an
    upload in progress.
  4. Disable link sharing (or enforce link passwords) and verify the
    multipart fallback still works.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

@Koc
Koc force-pushed the feature/chunked-file-upload branch from a941cff to 13e382e Compare September 14, 2026 18:12
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@Koc
Koc force-pushed the feature/chunked-file-upload branch from 13e382e to a7c89d1 Compare September 14, 2026 18:13
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use @nextcloud/upload for chunked file uploads

1 participant