ClassTelerikUpload
The class for the Telerik Upload component.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Syntax:
public class TelerikUpload : TelerikUploadBase<UploadFileInfo>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentTelerikUploadBase<UploadFileInfo>TelerikUpload
Implements:
Inherited Members
Constructors
TelerikUpload()
Declaration
public TelerikUpload()
Properties
AutoUpload
Automatically uploads files after selection when set to true
(default). Set to false
to require a manual upload button click. Example: false.
Files
Preloads a list of files into the Upload component on initialization. Example: bind to a list of UploadFileInfo. Useful for displaying previously uploaded files.
Declaration
[Parameter]
public IEnumerable<UploadFileInfo> Files { get; set; }
Property Value
OnCancel
Fires when a user clicks Cancel on a file that is uploading. Use to stop upload and update UI. Example: cancel upload of large file.
Declaration
[Parameter]
public EventCallback<UploadCancelEventArgs> OnCancel { get; set; }
Property Value
OnClear
Fires when the Clear button is clicked. Use to reset the file list or clear UI. Example: remove all files from the list.
Declaration
[Parameter]
public EventCallback<UploadClearEventArgs> OnClear { get; set; }
Property Value
OnError
Fires when an upload or remove request fails. Use to display error messages or retry logic. Example: show error notification if server returns 500.
Declaration
[Parameter]
public EventCallback<UploadErrorEventArgs> OnError { get; set; }
Property Value
OnPause
Fires when the Pause button is clicked. Use to pause chunked uploads. Only available when chunk upload and Resumable are enabled.
Declaration
[Parameter]
public EventCallback<UploadPauseEventArgs> OnPause { get; set; }
Property Value
OnProgress
Fires when upload progress changes. Use to update progress bars or UI. Example: show "Uploading 50%".
Declaration
[Parameter]
public EventCallback<UploadProgressEventArgs> OnProgress { get; set; }
Property Value
OnRemove
Fires when a user clicks Remove (X) on a file. Use to handle file deletion logic. Example: remove file from server or update UI. See OnError for failure handling.
Declaration
[Parameter]
public EventCallback<UploadEventArgs> OnRemove { get; set; }
Property Value
OnResume
Fires when the Resume button is clicked. Use to resume paused chunked uploads. Only available when chunk upload and Resumable are enabled.
Declaration
[Parameter]
public EventCallback<UploadResumeEventArgs> OnResume { get; set; }
Property Value
OnSelect
Fires when users select new files for upload. Use to validate or filter files before upload. Example: check file type or size. See OnUpload for upload logic.
Declaration
[Parameter]
public EventCallback<UploadSelectEventArgs> OnSelect { get; set; }
Property Value
OnSuccess
Fires when an upload or remove request succeeds. Use to update UI or notify users. Example: show "Upload complete" message.
Declaration
[Parameter]
public EventCallback<UploadSuccessEventArgs> OnSuccess { get; set; }
Property Value
OnUpload
Fires before uploading files. Use to add custom headers or cancel upload. Example: set args.IsCancelled = true
to prevent upload. Fires after OnSelect unless AutoUpload is false.
Declaration
[Parameter]
public EventCallback<UploadEventArgs> OnUpload { get; set; }
Property Value
RemoveField
Sets the FormData key for file names sent to RemoveUrl. Example: "files". Change if your server expects a different key.
Declaration
[Parameter]
public string RemoveField { get; set; }
Property Value
RemoveUrl
Sets the URL endpoint for removing uploaded files. Example: "https://myserver.com/remove". Must be configured for file deletion to work. See SaveUrl for upload endpoint.
Declaration
[Parameter]
public string RemoveUrl { get; set; }
Property Value
SaveField
Sets the FormData key for uploaded files sent to SaveUrl. Example: "files". Change if your server expects a different key.
Declaration
[Parameter]
public string SaveField { get; set; }
Property Value
SaveUrl
Sets the URL endpoint that receives uploaded files. Example: "https://myserver.com/upload". Required for file uploads to work. See RemoveUrl for file removal.
UploadSettings
Configures advanced upload settings, such as chunk upload. Use UploadChunkSettings as a child component. Example:
Declaration
[Parameter]
public RenderFragment UploadSettings { get; set; }
Property Value
WithCredentials
Enables sending credentials (cookies, headers) with cross-site requests. Set to true
if your upload endpoint requires authentication. Example: true.
Declaration
[Parameter]
public bool WithCredentials { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
Overrides
OnInitialized()
Declaration
protected override void OnInitialized()
Overrides