Lumeo

File Upload

A drag-and-drop file upload area with per-file progress tracking, validation, cancel, and retry.

Installation

dotnet add package Lumeo

One-time app setup (AddLumeo(), CSS & JS) is covered in the installation guide.

Usage

@using Lumeo

<FileUpload />

When to Use

  • File attachments in forms such as resumes, invoices, or supporting documents
  • Image uploads for profile pictures, product photos, or galleries
  • Document submissions with drag-and-drop zones for a better user experience
  • Bulk file uploads with per-file progress indicators, cancel, and retry

Switch between Dropzone, Button, and Avatar to see the upload surface change.

API Reference

FileUpload

Prop Type Default Description
Labelstring?nullPrimary label text shown in the drop zone.
Descriptionstring?nullSecondary description text shown below the label.
MultipleboolfalseAllows selecting multiple files at once.
Acceptstring?nullFile types accepted (e.g. "image/*", ".pdf,.docx").
MaxFileSizelong10 MBMaximum allowed file size in bytes.
MaxFilesint10Maximum number of files when Multiple is true.
ShowThumbnailsboolfalseShows image thumbnails for uploaded image files.
FileTemplateRenderFragment<IBrowserFile>?nullCustom template for rendering each selected file row (overrides default per-file UI).
VariantFileUpload.FileUploadVariantDropzoneUpload style variant. Values: Dropzone, Button, Avatar.
SizeLumeo.SizeDefaultButton size for Variant=Button. Values: Sm, Default, Lg.
OnFilesSelectedEventCallback<InputFileChangeEventArgs>Fires when files are selected (raw args, kept for back-compat).
OnUploadFunc<FileUploadItem, IProgress<int>, CancellationToken, Task<string?>>?nullUpload handler called per file. Report percent via IProgress, return the server URL/id on success, or throw on failure.
AutoUploadbooltrueStart uploads immediately after selection. Set false to show an explicit Upload button.
MaxConcurrentUploadsint3Maximum number of simultaneous OnUpload calls.
ChunkSizelong?nullOptional chunk-size hint (bytes) passed to each FileUploadItem for consumers implementing chunked upload.
OnFileUploadedEventCallback<FileUploadItem>Fires when a single file upload succeeds.
OnAllUploadedEventCallback<IReadOnlyList<FileUploadItem>>Fires when all queued uploads finish (succeeded, failed, or cancelled).
OnFileFailedEventCallback<FileUploadItem>Fires when a file upload fails.
OnFileRemovedEventCallback<FileUploadItem>Fires when a file is removed from the list.
OnFileRejectedEventCallback<(IBrowserFile, string)>Fires when a file is rejected by validation (size / type / count).
MaxFileSizeErrorstring?nullCustom error message when a file exceeds MaxFileSize.
MaxFilesErrorstring?nullCustom error message when MaxFiles is exceeded.
FileTypeErrorstring?nullCustom error message when a file type doesn't match Accept.
ShowProgressboolfalseLegacy: shows a global progress bar (only when OnUpload is not set).
Progressint0Legacy: global upload progress % (0–100). Superseded by per-file tracking when OnUpload is set.
Classstring?nullAdditional CSS classes on the root element.
AdditionalAttributesDictionary<string, object>?nullAdditional HTML attributes forwarded to the root element.
RequiredboolfalseMarks the field as required for form validation.
InvalidboolfalseApplies a destructive ring to indicate a validation error.
ErrorTextstring?nullError message shown below when Invalid is true (standalone, not inside FormField).
HelperTextstring?nullHelp text shown below when there is no error (standalone).
Namestring?nullHTML name attribute for form identification.
FormFieldFormFieldContext?nullCascaded context from a parent FormField; drives validation state automatically.

FileUploadItem

Represents the state of each file in the upload queue. Passed to OnUpload, OnFileUploaded, OnFileFailed, etc.

Property Type Description
IdstringUnique identifier (Guid hex) for this upload item.
FileIBrowserFileThe underlying browser file reference.
NamestringFile name.
SizelongFile size in bytes.
StatusFileUploadStatusCurrent status: Pending, Uploading, Succeeded, Failed, Cancelled.
ProgressPercentintUpload progress 0–100, updated via IProgress.
ErrorMessagestring?Error message if Status is Failed.
Urlstring?Server-returned URL or id after a successful upload.
ChunkSizelongChunk-size hint from the ChunkSize parameter (0 if not set).
  • Input — For standard text and data entry fields
  • Button — For triggering file selection via a button-style upload
  • Progress — For showing upload progress as a standalone bar