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

ParameterDefaultType
AutoResetfalsebool

If true file input will be automatically reset after it has being uploaded.
ButtonsTemplatenullRenderFragment<FilePickerButtonsContext>

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

Input content.
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.
FilePickerLocalizernullTextLocalizerHandler

Function used to handle custom localization that will override a default ITextLocalizer.
FileTemplatenullRenderFragment<FilePickerFileContext>

Provides a custom file content.
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.
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 value.
SegmentFetchTimeoutTimeSpan.FromMinutes( 1 )TimeSpan

Specifies the Segment Fetch Timeout when uploading the file.
ShowModeListFilePickerShowMode

Specifies FilePicker's show mode. Defaults to List
Possible values:ListDropdown

Events

EventType
ChangedEventCallback<FileChangedEventArgs>

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

Notifies when an individual file upload has ended.
ProgressedEventCallback<FileProgressedEventArgs>

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

Notifies when an individual file upload has started.
UploadEventCallback<FileUploadEventArgs>

Occurs once the FilePicker's Upload is triggered for every file.
WrittenEventCallback<FileWrittenEventArgs>

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

Methods

MethodReturnParameters
CancelTaskbool confirm

Cancels any ongoing upload operation.
ClearTaskbool confirm

Clears the FileInput by resetting the state.
GetFileSizeReadablestringIFileEntry file

Converts the file size in bytes into a proper human readable format.
GetFileStatusstringIFileEntry file

Gets the File Status
GetLocalizedStringstringstring name

Gets a FilePicker Localized string.
GetProgressPercentageint—

Gets progress for percentage display.
IsBusybool—

Tracks whether the FilePicker is busy and user interaction should be disabled.
IsFileBeingUploadedboolIFileEntry file

Tracks whether the current file is being uploaded.
IsUploadReadybool—

Tracks whether the FilePicker has files ready to upload.
RemoveFileTaskIFileEntry file, bool confirm

Removes the file from FileInput.
UploadAllTask—

Uploads the current files.
UploadFileTaskIFileEntry file, bool forceUpload

Uploads a single file if the status is set to ready.