Skip to content

SK-2844 add max file size and max file count support in multi file input element#693

Merged
skyflow-bharti merged 5 commits into
release/26.5.1from
SK-2844-add-max-file-size-and-max-file-count-validation-to-file-input-collect-element
May 27, 2026
Merged

SK-2844 add max file size and max file count support in multi file input element#693
skyflow-bharti merged 5 commits into
release/26.5.1from
SK-2844-add-max-file-size-and-max-file-count-validation-to-file-input-collect-element

Conversation

@skyflow-bharti
Copy link
Copy Markdown
Collaborator

SK-2819: Add maxFileSize and maxFileCount options to MULTI_FILE_INPUT element

Adds two new configurable validation options for MULTI_FILE_INPUT elements, giving developers control over per-file size limits and the maximum number of files that can be selected in a single upload.

Why

The MULTI_FILE_INPUT element previously applied a hard-coded 32 MB size cap and had no limit on the number of files a user could select. There was no way for developers to enforce stricter limits per their product requirements (e.g., a 5 MB cap for profile pictures, or restricting to 2 files per upload). This change exposes maxFileSize and maxFileCount as first-class options on the element so developers can configure these constraints at creation time rather than re-implementing validation outside the SDK.

Goal

maxFileSize: number — validates each selected file against a configurable byte limit. Defaults to 32_000_000 (32 MB). Applies only to MULTI_FILE_INPUT; FILE_INPUT is unaffected.
maxFileCount: number — validates the total number of selected files against a configurable integer limit. Defaults to 4. Applies only to MULTI_FILE_INPUT.
Both options produce specific, user-friendly inline error messages:

  • Single file too large → "File exceeds the X MB size limit. Choose a smaller file."
  • Named file(s) too large → "<filename(s)> exceeds the X MB size limit. Remove it or choose a smaller file." (all offending filenames are listed)
  • Count exceeded → "You can upload up to X files. Remove a file to add a new one."
    Both exceeded simultaneously → "You can upload up to X files, each under Y MB."

Invalid option values (non-positive number, non-integer count) throw a SKYFLOW_ERROR_CODE.INVALID_POSITIVE_NUMBER_OPTIONS error at element creation time.

@skyflow-bharti skyflow-bharti merged commit 183a9bc into release/26.5.1 May 27, 2026
4 checks passed
skyflow-bharti added a commit that referenced this pull request May 29, 2026
* SK-2844 add max file size and max file count support in multi file input element (#693)

---------

Co-authored-by: skyflow-bharti <skyflow-bharti@users.noreply.github.com>
skyflow-bharti added a commit that referenced this pull request May 29, 2026
* SK-2844 add max file size and max file count support in multi file input element (#693)
---------

Co-authored-by: skyflow-bharti <skyflow-bharti@users.noreply.github.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.

3 participants