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
public FileManagerUploadSettings()
Methods
public void Dispose()
Implements:
protected override void OnInitialized()
Overrides:
Properties
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.
[Parameter]
public List<string> AllowedExtensions { get; set; }
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.
[Parameter]
public long? MaxFileSize { get; set; }
Enforce a minimum file size in bytes. Files smaller than this are rejected during OnSelect.
Example: MinFileSize=1024 rejects files under 1 KB.
[Parameter]
public long? MinFileSize { get; set; }
Gets or sets a value indicating whether multiple file selection is allowed
Default value is false.
[Parameter]
public bool Multiple { get; set; }
Fires when the user cancels an in-progress upload. Use to clean up temporary server state if you manually created placeholders.
[Parameter]
public EventCallback<UploadCancelEventArgs> OnCancel { get; set; }
Fires when an upload or remove operation fails (network / server / validation). Inspect error details and show notifications. Related to OnSuccess for the happy path.
[Parameter]
public EventCallback<UploadErrorEventArgs> OnError { get; set; }
Fires periodically during file transmission. Use to display custom progress indicators (the built-in progress bar already reflects this).
[Parameter]
public EventCallback<UploadProgressEventArgs> OnProgress { get; set; }
Fires before a file removal request is sent. Validate permissions or block deletion by cancelling. Related to OnError for server failures while removing.
[Parameter]
public EventCallback<UploadEventArgs> OnRemove { get; set; }
Fires after files are selected (before upload starts). Validate extension, size or rename files. Combine with AllowedExtensions, MinFileSize and MaxFileSize for consistent UX.
[Parameter]
public EventCallback<UploadSelectEventArgs> OnSelect { get; set; }
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.
[Parameter]
public EventCallback<UploadSuccessEventArgs> OnSuccess { get; set; }
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).
[Parameter]
public EventCallback<UploadEventArgs> OnUpload { get; set; }
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".
[Parameter]
public string RemoveUrl { get; set; }
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".
[Parameter]
public string SaveField { get; set; }
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".
[Parameter]
public string SaveUrl { get; set; }
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.
[Parameter]
public bool WithCredentials { get; set; }