Blazorise File Picker API

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

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

API

Parameters

Parameter Description TypeDefault
AutoReset

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

boolfalse
ButtonsTemplate

Provides a custom content for upload, clear and cancel buttons.

RenderFragment<FilePickerButtonsContext>null
ChildTemplate

Input content.

RenderFragmentnull
Directory

Determines whether file picker should upload directories.

boolfalse
Disabled

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

boolfalse
DisableProgressReport

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.

boolfalse
Feedback

Placeholder for validation messages.

RenderFragmentnull
FilePickerLocalizer

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

TextLocalizerHandlernull
FileTemplate

Provides a custom file content.

RenderFragment<FilePickerFileContext>null
Filter

Specifies the types of files that the input accepts. See w3schools.com.

string
MaxChunkSize

Specifies the max chunk size when uploading the file.

int20 * 1024
MaxFileSize

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

longlong.MaxValue
Multiple

Enables the multiple file selection.

boolfalse
Placeholder

Sets the placeholder for the empty file input.

string
ReadOnly

Add the readonly boolean attribute on an input to prevent modification of the input value.

boolfalse
SegmentFetchTimeout

Specifies the Segment Fetch Timeout when uploading the file.

TimeSpanTimeSpan.FromMinutes( 1 )
ShowMode

Specifies FilePicker's show mode. Defaults to List

Possible values:List, Dropdown

FilePickerShowModeFilePickerShowMode.List

Events

Event Description Type
Changed

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

EventCallback<FileChangedEventArgs>
Ended

Notifies when an individual file upload has ended.

EventCallback<FileEndedEventArgs>
Progressed

Notifies the progress of file being written to the destination stream.

EventCallback<FileProgressedEventArgs>
Started

Notifies when an individual file upload has started.

EventCallback<FileStartedEventArgs>
Upload

Occurs once the FilePicker's Upload is triggered for every file.

EventCallback<FileUploadEventArgs>
Written

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

EventCallback<FileWrittenEventArgs>

Methods

Method DescriptionReturnParameters
Cancel Cancels any ongoing upload operation. Taskbool confirm
Clear Clears the FileInput by resetting the state. Taskbool confirm
GetFileSizeReadable Converts the file size in bytes into a proper human readable format. stringIFileEntry file
GetFileStatus Gets the File Status stringIFileEntry file
GetLocalizedString Gets a FilePicker Localized string. stringstring name
GetProgressPercentage Gets progress for percentage display. int
IsBusy Tracks whether the FilePicker is busy and user interaction should be disabled. bool
IsFileBeingUploaded Tracks whether the current file is being uploaded. boolIFileEntry file
IsUploadReady Tracks whether the FilePicker has files ready to upload. bool
RemoveFile Removes the file from FileInput. TaskIFileEntry file, bool confirm
UploadAll Uploads the current files. Task
UploadFile Uploads a single file if the status is set to ready. TaskIFileEntry file, bool forceUpload
On this page