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 | Type | Default |
|---|---|---|---|
AutoReset |
If true file input will be automatically reset after it has being uploaded. |
bool | false |
ButtonsTemplate |
Provides a custom content for upload, clear and cancel buttons. |
RenderFragment<FilePickerButtonsContext> | null |
ChildTemplate |
Input content. |
RenderFragment | null |
Directory |
Determines whether file picker should upload directories. |
bool | false |
Disabled |
Add the disabled boolean attribute on an input to prevent user interactions and make it appear lighter. |
bool | false |
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. |
bool | false |
Feedback |
Placeholder for validation messages. |
RenderFragment | null |
FilePickerLocalizer |
Function used to handle custom localization that will override a default ITextLocalizer. |
TextLocalizerHandler | null |
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. |
int | 20 * 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. |
long | long.MaxValue |
Multiple |
Enables the multiple file selection. |
bool | false |
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. |
bool | false |
SegmentFetchTimeout |
Specifies the Segment Fetch Timeout when uploading the file. |
TimeSpan | TimeSpan.FromMinutes( 1 ) |
ShowMode |
Specifies FilePicker's show mode. Defaults to List Possible values: |
FilePickerShowMode | FilePickerShowMode.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 | Description | Return | Parameters |
|---|---|---|---|
Cancel |
Cancels any ongoing upload operation. | Task | bool confirm |
Clear |
Clears the FileInput by resetting the state. | Task | bool confirm |
GetFileSizeReadable |
Converts the file size in bytes into a proper human readable format. | string | IFileEntry file |
GetFileStatus |
Gets the File Status | string | IFileEntry file |
GetLocalizedString |
Gets a FilePicker Localized string. | string | string 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. | bool | IFileEntry file |
IsUploadReady |
Tracks whether the FilePicker has files ready to upload. | bool | |
RemoveFile |
Removes the file from FileInput. | Task | IFileEntry file, bool confirm |
UploadAll |
Uploads the current files. | Task | |
UploadFile |
Uploads a single file if the status is set to ready. | Task | IFileEntry file, bool forceUpload |