**FileInput** BitFileInput component wraps the HTML file input element and allows the user to select file(s) without uploading them. The selected files are returned to the C# context for further processing. It provides several options including single or multiple file selection, drag and drop support, file size validation, and file extension filtering. **Basic**: **Multiple**: **AutoReset**: **Append**: **MaxSize**: **AllowedExtensions**: **Removable**: **Events**:
Selected files:
@foreach (var file in selectedFiles) {
@file.Name (@FileSizeHumanizer.Humanize(file.Size)) @if (file.Content is not null) { - @file.Content.Length bytes loaded }
} private BitFileInput eventsFileInput = default!; private BitFileInputInfo[] selectedFiles = []; private async Task HandleOnChange(BitFileInputInfo[] files) { selectedFiles = files; foreach (var file in files) { if (file.IsValid && file.Content is null) { await eventsFileInput.ReadContentAsync(file); } } } **Templates**: @if (bitFileInput.Files?.Any() is not true) {
Drag and drop or
Browse files
}
@if (!string.IsNullOrEmpty(file.Name)) {
@file.Name
@FileSizeHumanizer.Humanize(file.Size)
@if (!file.IsValid) {
@file.Message
}
}
private BitFileInput bitFileInput = default!; **Public API**: Browse file Reset private BitFileInput publicApiFileInput = default!; **External Icons**: