Inputs
FileUpload
Bit.BlazorUI
BitFileUpload sends the files a user picks, drops or pastes to a server endpoint over HTTP - whole or in resumable chunks - with per-file progress, pause, cancel, retry and server-side removal, validation on arrival, and a fully themable, templatable and screen-reader friendly UI. For file selection without uploading, use BitFileInput.
Selection & validation
Multiple, appended and auto-uploaded selections, the size, count and custom rules, folders and the camera, and image previews with their dimensions.
Selection behavior
Multiple takes several files at once, AutoUpload sends them as soon as they arrive,
Append adds a new selection to the list instead of replacing it, and AutoReset empties the
list before each browse. With AllowDuplicates off, re-picking a file already in the list is rejected.
Multiple, auto-uploaded:
Appending, without duplicates - try selecting the same file twice:
AutoReset - every browse starts from an empty list:
Validation
Rules run when a file arrives, however it arrives; a rejected file stays in the list with its reason and is
never sent. MaxSize / MinSize bound each file, MaxTotalSize and MaxCount the
whole list (re-checked after every removal), and FileValidator adds a rule of your own. Each has
its own ...ErrorMessage.
Up to 1 MB per file.
Up to 3 files, 2 MB in total.
Empty (zero-byte) files are turned away.
AllowedExtensions is the type rule - extensions with or without the dot, or MIME types like
image/* - and also fills the dialog filter. Accept alone only filters the dialog; a drop
walks past it. When the rule is MIME-only, or a drag holds more files than MaxCount leaves room for,
the drop indicator turns red before the drop (Classes.DraggingRejected restyles it).
Up to 3 images or PDFs - drag anything else over to see it refused.
GIF, JPG or MP4.
Accept only: the dialog filters, a dropped file of any type is still taken.
Directory & Capture
Directory picks - or accepts a drop of - a whole folder, subfolders included, with every file still
validated. Capture opens the camera on a mobile device: "user" for the front one,
"environment" for the rear one.
Up to 20 files out of the chosen folder.
Opens the rear camera on a mobile device.
Opens the front camera on a mobile device.
Preview & image dimensions
ShowPreview shows a thumbnail of each image, made in the browser and released on removal, and a
type glyph for anything else. ReadImageDimensions fills Width / Height before
validation, so a FileValidator can reject an image by its pixels.
Images between 200x200 and 4000x4000 pixels.
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.