Blazorise File Input API

Explore the Blazorise File Input API reference for parameters, events, methods, and related types.

For examples and usage guidance, see the File Input documentation.

API

Parameters

ParameterDefaultType
AriaDescribedBy—string

Specifies the aria-describedby attribute value.
When set, this value is rendered as-is and overrides help and validation message ids generated by Field and Validation.
AriaInvalid—string

Specifies the aria-invalid attribute value.
When set, this value is rendered as-is and overrides the validation-derived aria-invalid state.
AriaLabelledBy—string

Specifies the aria-labelledby attribute value.
When set, this value is rendered as-is. Some non-labelable controls can otherwise derive it automatically from a parent FieldLabel or FieldsLabel.
AriaRequiredfalsebool

Specifies the aria-required attribute value.
When set, this value overrides the required-field state resolved from the parent Validation.
Autofocusfalsebool

Set's the focus to the component after the rendering is done.
AutoResettruebool

If true file input will be automatically reset after it has being uploaded.
BrowseButtonLocalizernullTextLocalizerHandler

Function used to handle custom localization that will override a default ITextLocalizer.
ChildContentnullRenderFragment

Specifies the content to be rendered inside this FileInput.
Directoryfalsebool

Determines whether file picker should upload directories.
Disabledfalsebool

Add the disabled boolean attribute on an input to prevent user interactions and make it appear lighter.
DisableProgressReportfalsebool

Determines whether report progress should be disabled. By enabling this setting, Progressed and Written callbacks won't be called. Internal file progress won't be tracked.

This setting can speed up file transfer considerably.

FeedbacknullRenderFragment

Placeholder for validation messages.
Filter—string

Specifies the types of files that the input accepts. See w3schools.com.
MaxChunkSize20 * 1024int

Specifies the max chunk size when uploading the file. Take note that if you're using IFileEntry,CancellationToken) you're provided with a stream and should configure the chunk size when handling with the stream.
MaxFileSizelong.MaxValuelong

Maximum file size in bytes, checked before starting upload (note: never trust client, always check file size at server-side). Defaults to long.MaxValue.
Multiplefalsebool

Enables the multiple file selection.
Placeholder—string

Sets the placeholder for the empty file input.
ReadOnlyfalsebool

Add the readonly boolean attribute on an input to prevent modification of the input’s value.
SegmentFetchTimeoutTimeSpan.FromMinutes( 1 )TimeSpan

Specifies the Segment Fetch Timeout when uploading the file.
SizeDefaultSize?

Sets the size of the input control.
When omitted, uses the parent Addons size, then the theme input size, then Size.Default.
TabIndexnullint?

If defined, indicates that its element can be focused and can participates in sequential keyboard navigation.
ValuenullTValue

Specifies the value inside the input field.
ValueExpressionnullExpression<Func<TValue>>

Specifies an expression that identifies the input value.

Events

EventType
BlurEventCallback<FocusEventArgs>

The blur event fires when an element has lost focus.
ChangedEventCallback<FileChangedEventArgs>

Occurs every time the selected file has changed, including when the reset operation is executed.
CustomValidationValueFunc<TValue>

Used to provide custom validation value on which the validation will be processed with the Validator handler.
Should be used carefully as it's only meant for some special cases when input is used in a wrapper component, like Autocomplete or SelectList.
EndedEventCallback<FileEndedEventArgs>

Notifies when an individual file upload has ended.
FocusInEventCallback<FocusEventArgs>

Notifies when the input box gains focus.
FocusOutEventCallback<FocusEventArgs>

Notifies when the input box loses focus.
KeyDownEventCallback<KeyboardEventArgs>

Notifies when a key is pressed down while the control has focus.
KeyPressEventCallback<KeyboardEventArgs>

Notifies when a key is pressed while the control has focus.
KeyUpEventCallback<KeyboardEventArgs>

Notifies when a key is released while the control has focus.
OnFocusEventCallback<FocusEventArgs>

Notifies when the input box gains or loses focus.
ProgressedEventCallback<FileProgressedEventArgs>

Notifies the progress of file being written to the destination stream.
StartedEventCallback<FileStartedEventArgs>

Notifies when an individual file upload has started.
ValueChangedEventCallback<TValue>

Occurs after value has changed.
WrittenEventCallback<FileWrittenEventArgs>

Occurs every time the part of file has being written to the destination stream.

Methods

MethodReturnParameters
NotifyChangeTaskFileEntry[] files

Notifies the component that file input value has changed.
OpenReadStreamStreamIFileEntry fileEntry, CancellationToken cancellationToken

Opens the stream for reading the uploaded file.
RemoveFileEntryTaskIFileEntry fileEntry, CancellationToken cancellationToken

Removes the file entry from js dictionary.
RemoveFileValueTaskint fileId

Removes a file from the current file selection.
ResetValueTask—

Manually resets the input file value.
ShowPickerTask—

Show a browser picker for the file input.
UpdateFileEndedAsyncTaskIFileEntry fileEntry, bool success, FileInvalidReason fileInvalidReason

Notifies the component that file upload has ended.
UpdateFileProgressAsyncTaskIFileEntry fileEntry, long progressProgress

Updated the component with the latest upload progress.
UpdateFileStartedAsyncTaskIFileEntry fileEntry

Notifies the component that file upload is about to start.
UpdateFileWrittenAsyncTaskIFileEntry fileEntry, long position, byte[] data

Updates component with the latest file data.
WriteToStreamAsyncTaskIFileEntry fileEntry, Stream stream, CancellationToken cancellationToken

Writes the file data to the target stream.
FocusTaskbool scrollToElement

Sets the focus on the underline element.
RevalidateTask—

Forces the Validation (if any is used) to re-validate with the new custom or internal value.
On this page