Skip to navigation

File restrictions and validation options

Options that limit which files users can select and validate them before or after upload.

Related guides: Custom validation.

See all options for the full list.

imgOnly

Accept images only.

Attribute: img-only

DOM property: imgOnly

Type: boolean

Default: false

accept

Native file input accept attribute value. Also affects client validation settings.

Attribute: accept

DOM property: accept

Type: string

Default: ''

maxLocalFileSizeBytes

Maximum size in bytes for local files.

Attribute: max-local-file-size-bytes

DOM property: maxLocalFileSizeBytes

Type: number

Default: 0: means no limit

fileValidators Since v0.43.0

Works as DOM property only.

Specify a file validators list. See File validators for details.

Attribute: -

DOM property: fileValidators

Type: Array<(outputFile: OutputFileEntry, ctx: UploaderPublicApi) => CustomValidatorError>

Default: []

collectionValidators Since v0.43.0

Works as DOM property only.

Specify a collection validators list. See Collection validators for details.

Attribute: -

DOM property: collectionValidators

Type: Array<(outputFile: OutputCollectionState, ctx: UploaderPublicApi) => CustomValidatorError>

Default: []

validationTimeout Since v1.23.0

Sets the maximum time (in milliseconds) a single validator is allowed to run before it is aborted and skipped.

Use this to prevent long-running sync/async validators from blocking the UI if they hang or take too long. When the timeout is reached, the validator is cancelled via AbortSignal (for async validators) and its result is ignored.

See also: File validators

Attribute: validation-timeout

DOM property: validationTimeout

Type: number

Default: 15000

validationConcurrency Since v1.23.0

Limits how many files could be validated simultaneously.

Lower values reduce CPU usage and improve responsiveness on weaker devices; higher values validate faster for large selections.

See also: File validators

Attribute: validation-concurrency

DOM property: validationConcurrency

Type: number

Default: 100