**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**:
@if (bitFileInput.Files?.Any() is not true)
{
@if (!string.IsNullOrEmpty(file.Name))
{
@if (!file.IsValid)
{
}
private BitFileInput bitFileInput = default!;
**Public API**:
Browse file
Reset
private BitFileInput publicApiFileInput = default!;
**External Icons**:
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**:
bitFileInput.Browse()">
}
Drag and drop or
Browse files
@file.Name
@FileSizeHumanizer.Humanize(file.Size)
bitFileInput.RemoveFile(file)" />
@file.Message
}