Class BOBInputFile
- Namespace
- BlazOrbit.Components.Forms
- Assembly
- BlazOrbit.dll
[GenerateComponentInfo]
public class BOBInputFile : BOBComponentBase, IHasSize, IHasDensity
- Inheritance
-
objectComponentBaseBOBInputFile
- Implements
- Inherited Members
Constructors
BOBInputFile()
public BOBInputFile()
Properties
Accept
Native accept filter passed to Microsoft.AspNetCore.Components.Forms.InputFile (e.g. "image/*,.pdf").
[Parameter]
public string? Accept { get; set; }
Property Value
- string
ChildContent
Custom drop-zone content. When omitted, a default icon + title + hint is rendered.
[Parameter]
public RenderFragment? ChildContent { get; set; }
Property Value
- RenderFragment
Density
Vertical density of the file list.
[Parameter]
public BOBDensity Density { get; set; }
Property Value
Disabled
When true, the entire control is disabled.
[Parameter]
public bool Disabled { get; set; }
Property Value
- bool
DisallowedTypeText
Localised label rendered for the DisallowedType error kind.
[Parameter]
public string? DisallowedTypeText { get; set; }
Property Value
- string
DropZoneHint
Hint rendered below the drop-zone title.
[Parameter]
public string DropZoneHint { get; set; }
Property Value
- string
DropZoneText
Text rendered as the drop-zone title when no ChildContent is provided.
[Parameter]
public string? DropZoneText { get; set; }
Property Value
- string
FailedText
Aria-label rendered on the failure indicator after an upload fails.
[Parameter]
public string? FailedText { get; set; }
Property Value
- string
GeneratePreviews
When true (default), generate base64 image thumbnails for image/* files.
[Parameter]
public bool GeneratePreviews { get; set; }
Property Value
- bool
HelperText
Helper text rendered below the drop zone (above the file list).
[Parameter]
public string? HelperText { get; set; }
Property Value
- string
Label
Optional label rendered above the drop zone.
[Parameter]
public string? Label { get; set; }
Property Value
- string
MaxFiles
Maximum number of accepted files. Defaults to 10.
[Parameter]
public int MaxFiles { get; set; }
Property Value
- int
MaxSize
Maximum allowed size per file in bytes. Defaults to 10 MB.
[Parameter]
public long MaxSize { get; set; }
Property Value
- long
Multiple
[Parameter]
public bool Multiple { get; set; }
Property Value
- bool
OnFilesSelected
Raised after a selection completes, with the validated files.
[Parameter]
public EventCallback<IReadOnlyList<IBrowserFile>> OnFilesSelected { get; set; }
Property Value
- EventCallback<IReadOnlyList<IBrowserFile>>
OnInvalid
Raised when one or more files are rejected by the client-side validators.
[Parameter]
public EventCallback<IReadOnlyList<BOBFileValidationError>> OnInvalid { get; set; }
Property Value
- EventCallback<IReadOnlyList<BOBFileValidationError>>
OnRemoved
Raised when the user removes a file from the list.
[Parameter]
public EventCallback<IBrowserFile> OnRemoved { get; set; }
Property Value
- EventCallback<IBrowserFile>
PreviewMaxBytes
Maximum bytes streamed for preview generation. Defaults to 5 MB.
[Parameter]
public long PreviewMaxBytes { get; set; }
Property Value
- long
RemoveText
Aria label for the per-row remove button.
[Parameter]
public string? RemoveText { get; set; }
Property Value
- string
Size
Visual size of the drop-zone and previews.
[Parameter]
public BOBSize Size { get; set; }
Property Value
TooLargeText
Localised label rendered for the TooLarge error kind.
[Parameter]
public string? TooLargeText { get; set; }
Property Value
- string
TooManyFilesText
Localised label rendered for the TooManyFiles error kind.
[Parameter]
public string? TooManyFilesText { get; set; }
Property Value
- string
UploadedText
Aria-label rendered on the success indicator after an upload completes.
[Parameter]
public string? UploadedText { get; set; }
Property Value
- string
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder
SetStatus(IBrowserFile, BOBFileStatus, double, string?)
Reports upload progress for a previously selected file. The consumer drives the upload (typically via BOBChunkedUploader) and calls this method on every chunk to advance the per-entry progress bar. The lookup is by reference against the original Microsoft.AspNetCore.Components.Forms.IBrowserFile returned by OnFilesSelected. No-op when the file is no longer in the list.
public void SetStatus(IBrowserFile file, BOBFileStatus status, double progressPercent = 0, string? statusMessage = null)
Parameters
fileIBrowserFileThe browser file whose entry should update.
statusBOBFileStatusNew terminal or in-flight status.
progressPercentdouble0–100 progress for Uploading; ignored otherwise.
statusMessagestringOptional message — surfaced as a tooltip on the status glyph (typically used for Failed).