Conversation
Accept a repeated file field, upload each file in turn, and report how many were uploaded. The error page is shown only when none were. Fixes #952
rmdes
force-pushed
the
feat/endpoint-files-multiple-upload
branch
from
September 13, 2026 11:20
7c052e8 to
7bb0cb5
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #952.
views/file-form.njk: the file input getsmultiple. No script, no new component.lib/controllers/form.js:request.files.fileis normalised to an array and each file is posted to the media endpoint in turn (sequential on purpose: a Git-backed store may reject concurrent writes, GitHub upload conflict when uploading multiple images #792). One file keeps today's message from the media endpoint; several reportfiles.upload.success(“%s files uploaded”); a mix reportsfiles.upload.partial(“%s of %s files uploaded”); when nothing was uploaded the form re-renders with the last error, as it does now for one file.locales/en.json: the two new strings, English only.partial-post-upload.exampleorigin answers 201 then 400.multipleinput; two files redirect with “2 files uploaded”; one of two failing redirects with “1 of 2 files uploaded”; two files against the 401 endpoint render the error. Three of these fail onmain.Verified locally:
node --test packages/endpoint-files/test/**/*.js18/18, eslint and prettier clean.