Class
TelerikUpload

A component that lets users select and upload files with progress, validation, and events. Supports endpoints via SaveUrl/RemoveUrl and form keys SaveField/RemoveField, credentials with WithCredentials, auto/manual upload through AutoUpload, multiple selection, allowed extensions and size limits, chunk upload via UploadChunkSettings, preloaded Files, and lifecycle events (OnSelect, OnUpload, OnProgress, OnSuccess, OnError, OnCancel, OnClear, OnPause, OnResume).

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

cs-api-definition
public class TelerikUpload : TelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>TelerikUpload

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members TelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.OnAfterRenderAsync(bool)TelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.ClearFiles()TelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.OpenSelectFilesDialog()TelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.SelectFilesButtonTemplateTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.EnabledTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.MultipleTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.AcceptTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.AllowedExtensionsTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.MinFileSizeTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.MaxFileSizeTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.IdTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.CaptureTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.DropZoneIdTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.AriaDescribedByTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.AriaLabelledByTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.FilesTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.FileTemplateTelerikUploadBase<UploadFileInfo, UploadFileTemplateContext, UploadFileInfoTemplateContext>.FileInfoTemplateBaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.OnAfterRenderAsync(bool)BaseComponent.Dispose()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnParametersSet()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)

Constructors

TelerikUpload()

Declaration

cs-api-definition
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.

Declaration

cs-api-definition
[Parameter]
public bool AutoUpload { get; set; }

Property Value

bool

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

cs-api-definition
[Parameter]
public IEnumerable<UploadFileInfo> Files { get; set; }

Property Value

IEnumerable<UploadFileInfo>

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

cs-api-definition
[Parameter]
public EventCallback<UploadCancelEventArgs> OnCancel { get; set; }

Property Value

EventCallback<UploadCancelEventArgs>

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

cs-api-definition
[Parameter]
public EventCallback<UploadClearEventArgs> OnClear { get; set; }

Property Value

EventCallback<UploadClearEventArgs>

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

cs-api-definition
[Parameter]
public EventCallback<UploadErrorEventArgs> OnError { get; set; }

Property Value

EventCallback<UploadErrorEventArgs>

OnPause

Fires when the Pause button is clicked. Use to pause chunked uploads. Only available when chunk upload and Resumable are enabled.

Declaration

cs-api-definition
[Parameter]
public EventCallback<UploadPauseEventArgs> OnPause { get; set; }

Property Value

EventCallback<UploadPauseEventArgs>

OnProgress

Fires when upload progress changes. Use to update progress bars or UI. Example: show "Uploading 50%".

Declaration

cs-api-definition
[Parameter]
public EventCallback<UploadProgressEventArgs> OnProgress { get; set; }

Property Value

EventCallback<UploadProgressEventArgs>

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

cs-api-definition
[Parameter]
public EventCallback<UploadEventArgs> OnRemove { get; set; }

Property Value

EventCallback<UploadEventArgs>

OnResume

Fires when the Resume button is clicked. Use to resume paused chunked uploads. Only available when chunk upload and Resumable are enabled.

Declaration

cs-api-definition
[Parameter]
public EventCallback<UploadResumeEventArgs> OnResume { get; set; }

Property Value

EventCallback<UploadResumeEventArgs>

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

cs-api-definition
[Parameter]
public EventCallback<UploadSelectEventArgs> OnSelect { get; set; }

Property Value

EventCallback<UploadSelectEventArgs>

OnSuccess

Fires when an upload or remove request succeeds. Use to update UI or notify users. Example: show "Upload complete" message.

Declaration

cs-api-definition
[Parameter]
public EventCallback<UploadSuccessEventArgs> OnSuccess { get; set; }

Property Value

EventCallback<UploadSuccessEventArgs>

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

cs-api-definition
[Parameter]
public EventCallback<UploadEventArgs> OnUpload { get; set; }

Property Value

EventCallback<UploadEventArgs>

PopupId

Declaration

cs-api-definition
public string PopupId { get; }

Property Value

string

RemoveField

Sets the FormData key for file names sent to RemoveUrl. Example: "files". Change if your server expects a different key.

Declaration

cs-api-definition
[Parameter]
public string RemoveField { get; set; }

Property Value

string

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

cs-api-definition
[Parameter]
public string RemoveUrl { get; set; }

Property Value

string

SaveField

Sets the FormData key for uploaded files sent to SaveUrl. Example: "files". Change if your server expects a different key.

Declaration

cs-api-definition
[Parameter]
public string SaveField { get; set; }

Property Value

string

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.

Declaration

cs-api-definition
[Parameter]
public string SaveUrl { get; set; }

Property Value

string

UploadSettings

Configures advanced upload settings, such as chunk upload. Use UploadChunkSettings as a child component. Example: .

Declaration

cs-api-definition
[Parameter]
public RenderFragment UploadSettings { get; set; }

Property Value

RenderFragment

WithCredentials

Enables sending credentials (cookies, headers) with cross-site requests. Set to true if your upload endpoint requires authentication. Example: true.

Declaration

cs-api-definition
[Parameter]
public bool WithCredentials { get; set; }

Property Value

bool

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

CancelFile(string)

Cancels the upload of the specified file and removes it from the collection.

Declaration

cs-api-definition
public void CancelFile(string fileId)

Parameters

fileId

string

The unique identifier of the file to cancel.

OnInitialized()

Declaration

cs-api-definition
protected override void OnInitialized()

Overrides ComponentBase.OnInitialized()

PauseFile(string)

Pauses the upload of the file with the specified identifier, if it exists in the current collection.

Declaration

cs-api-definition
public void PauseFile(string fileId)

Parameters

fileId

string

The unique identifier of the file to pause.

RemoveFile(string)

Removes the file with the specified identifier from the collection.

Declaration

cs-api-definition
public void RemoveFile(string fileId)

Parameters

fileId

string

The unique identifier of the file to remove.

ResumeFile(string)

Resumes the upload process for the specified file.

Declaration

cs-api-definition
public void ResumeFile(string fileId)

Parameters

fileId

string

The unique identifier of the file to resume.

RetryFile(string)

Attempts to retry the upload of a file with the specified identifier.

Declaration

cs-api-definition
public void RetryFile(string fileId)

Parameters

fileId

string

The unique identifier of the file to retry.

UploadFiles()

Uploads all valid files.

Declaration

cs-api-definition
public void UploadFiles()