feat(files): Add multiple files upload field - #755
Closed
aXenDeveloper wants to merge 1 commit into
Closed
Conversation
Adds first-party support for uploading several files at once: a `POST /users/files` endpoint that takes a repeated `files` field, and an `AutoFormFiles` form field that talks to it by picking or dropping files. - Role settings (`allowUploadFiles`, `totalMaxStorage`, `maxStorageForSubmit`) are finally enforced: the most permissive caps across a user's roles, with `null` meaning unlimited and `root` bypassing both. - The batch is validated as a whole before anything is stored, and a failure halfway removes what already landed, so a rejected batch stores nothing. - `GET /users/files/upload-limits` reports what the user may upload now, so the field refuses a file without spending an upload - the same rule, shared code. - `storage.uploads` config picks the accepted MIME types (wildcards welcome), the folder and the per-submit file count. SVG is left out of the defaults. - `StorageModel.upload()` now returns the `core_files` row it created, and its MIME allowlist understands `image/*`. - Every stored file emits the new `file.uploaded` event. - "My Files" gets an upload dialog built on the field. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVna1pS31PRmWr9JPVSggf
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Adds first-party support for uploading several files at once: a
POST /users/filesendpoint that takes a repeatedfilesfield, and anAutoFormFilesform field that talks to it by picking or dropping files.allowUploadFiles,totalMaxStorage,maxStorageForSubmit)are finally enforced: the most permissive caps across a user's roles, with
nullmeaning unlimited androotbypassing both.halfway removes what already landed, so a rejected batch stores nothing.
GET /users/files/upload-limitsreports what the user may upload now, so thefield refuses a file without spending an upload - the same rule, shared code.
storage.uploadsconfig picks the accepted MIME types (wildcards welcome),the folder and the per-submit file count. SVG is left out of the defaults.
StorageModel.upload()now returns thecore_filesrow it created, and itsMIME allowlist understands
image/*.file.uploadedevent.Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01UVna1pS31PRmWr9JPVSggf