UseFileInputOptions
Extends
Section titled “Extends”Properties
Section titled “Properties”accept?
Section titled “accept?”optional accept?: string;Comma-separated accept string, exactly as <input accept> takes it:
extensions (.png), full types (image/png), and wildcards (image/*).
Inherited from
Section titled “Inherited from”announce?
Section titled “announce?”optional announce?: (event) => string;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | { added?: number; files: File[]; rejected?: FileAttempt[]; type: "add" | "remove" | "reject"; } |
event.added? | number |
event.files | File[] |
event.rejected? | FileAttempt[] |
event.type | "add" | "remove" | "reject" |
Returns
Section titled “Returns”string
dedupe?
Section titled “dedupe?”optional dedupe?: boolean;Treat two files with the same name, size and timestamp as the same file.
Default
Section titled “Default”trueInherited from
Section titled “Inherited from”defaultValue?
Section titled “defaultValue?”optional defaultValue?: File[];disabled?
Section titled “disabled?”optional disabled?: boolean;optional id?: string;maxFiles?
Section titled “maxFiles?”optional maxFiles?: number;Maximum number of files.
Inherited from
Section titled “Inherited from”maxSize?
Section titled “maxSize?”optional maxSize?: number;Largest allowed file, in bytes.
Inherited from
Section titled “Inherited from”minSize?
Section titled “minSize?”optional minSize?: number;Smallest allowed file, in bytes. Catches the 0-byte file a failed copy leaves behind.
Inherited from
Section titled “Inherited from”multiple?
Section titled “multiple?”optional multiple?: boolean;onAdd?
Section titled “onAdd?”optional onAdd?: (file, files) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
file | File |
files | File[] |
Returns
Section titled “Returns”void
onBlur?
Section titled “onBlur?”optional onBlur?: (event) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | FocusEvent<HTMLElement> |
Returns
Section titled “Returns”void
onChange?
Section titled “onChange?”optional onChange?: (files) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
files | File[] |
Returns
Section titled “Returns”void
onFocus?
Section titled “onFocus?”optional onFocus?: (event) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | FocusEvent<HTMLElement> |
Returns
Section titled “Returns”void
onReject?
Section titled “onReject?”optional onReject?: (attempt) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
attempt | FileAttempt |
Returns
Section titled “Returns”void
onRemove?
Section titled “onRemove?”optional onRemove?: (file, index, files) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
file | File |
index | number |
files | File[] |
Returns
Section titled “Returns”void
onWarn?
Section titled “onWarn?”optional onWarn?: (warning) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
warning | FileWarning |
Returns
Section titled “Returns”void
previews?
Section titled “previews?”optional previews?: boolean;readOnly?
Section titled “readOnly?”optional readOnly?: boolean;validate?
Section titled “validate?”optional validate?: (file, existing) => string | boolean;Final say. Return true, false, or a string explaining the refusal.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
file | File |
existing | File[] |
Returns
Section titled “Returns”string | boolean
Inherited from
Section titled “Inherited from”value?
Section titled “value?”optional value?: File[];