ClassFileManagerUploadSettings
Configures file upload functionality including server endpoints, file restrictions, and upload events.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Syntax:
public class FileManagerUploadSettings : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseFileManagerUploadSettings
Implements:
Inherited Members
Constructors
FileManagerUploadSettings()
Declaration
public FileManagerUploadSettings()
Properties
AllowedExtensions
Restrict selectable file types by extension (case-insensitive). Provide values with leading dot (e.g., .pdf
, .png
). Empty or null = allow all.
Also validate again on the server for security.
MaxFileSize
Enforce a maximum file size in bytes. Files larger than this are rejected during OnSelect.
Example: MaxFileSize=5242880
limits to 5 MB.
Set together with AllowedExtensions for full client-side validation guidance.
Declaration
[Parameter]
public long? MaxFileSize { get; set; }
Property Value
long?
MinFileSize
Enforce a minimum file size in bytes. Files smaller than this are rejected during OnSelect.
Example: MinFileSize=1024
rejects files under 1 KB.
Declaration
[Parameter]
public long? MinFileSize { get; set; }
Property Value
long?
OnCancel
Fires when the user cancels an in-progress upload. Use to clean up temporary server state if you manually created placeholders.
Declaration
[Parameter]
public EventCallback<UploadCancelEventArgs> OnCancel { get; set; }
Property Value
OnError
Fires when an upload or remove operation fails (network / server / validation). Inspect error details and show notifications. Related to OnSuccess for the happy path.
Declaration
[Parameter]
public EventCallback<UploadErrorEventArgs> OnError { get; set; }
Property Value
OnProgress
Fires periodically during file transmission. Use to display custom progress indicators (the built-in progress bar already reflects this).
Declaration
[Parameter]
public EventCallback<UploadProgressEventArgs> OnProgress { get; set; }
Property Value
OnRemove
Fires before a file removal request is sent. Validate permissions or block deletion by cancelling. Related to OnError for server failures while removing.
Declaration
[Parameter]
public EventCallback<UploadEventArgs> OnRemove { get; set; }
Property Value
OnSelect
Fires after files are selected (before upload starts). Validate extension, size or rename files. Combine with AllowedExtensions, MinFileSize and MaxFileSize for consistent UX.
Declaration
[Parameter]
public EventCallback<UploadSelectEventArgs> OnSelect { get; set; }
Property Value
OnSuccess
Fires after a file successfully uploads. Access server response or update FileManager data source.
Typical use: refresh FileManager listing (await FileManagerRef.ProcessDataAsync()
) when new files appear.
Declaration
[Parameter]
public EventCallback<UploadSuccessEventArgs> OnSuccess { get; set; }
Property Value
OnUpload
Fires just before an upload starts (per file batch). Use to add custom headers, additional form fields or to cancel.
Set e.IsCancelled = true
(if available) or throw to prevent the upload. Related to OnSelect (file chosen) and OnSuccess (completed).
Declaration
[Parameter]
public EventCallback<UploadEventArgs> OnUpload { get; set; }
Property Value
RemoveField
Set the form key that lists file names for deletion requests to RemoveUrl. Default is "files".
Usually matches SaveField. Example: RemoveField="attachments"
.
Declaration
[Parameter]
public string RemoveField { get; set; }
Property Value
RemoveUrl
Set the endpoint that handles deletion of previously uploaded files (HTTP POST/DELETE depending on implementation).
The request payload contains file names under RemoveField (default: "files").
Example: RemoveUrl="/api/files/delete"
.
Declaration
[Parameter]
public string RemoveUrl { get; set; }
Property Value
SaveField
Set the form field name that carries uploaded file(s) to SaveUrl. Default is "files".
Change only if your backend expects a different key. Example: SaveField="attachments"
.
Declaration
[Parameter]
public string SaveField { get; set; }
Property Value
SaveUrl
Set the endpoint that receives uploaded file content (HTTP POST). Required for server (async) upload.
You receive one or more files under the form field specified by SaveField (default: "files").
Example: SaddveUrl="/api/files/upload"
.
WithCredentials
Send cross-site credentials (cookies, authorization headers) with upload/remove requests when true
.
Enable only if your API requires authentication and CORS allows credentials. Mirrors the browser withCredentials
flag.
Declaration
[Parameter]
public bool WithCredentials { get; set; }
Property Value
Methods
Dispose()
Declaration
public void Dispose()
Implements
OnInitialized()
Declaration
protected override void OnInitialized()
Overrides