Class
TelerikUpload

The class for the Telerik Upload component.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

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

Inheritance: objectComponentBaseBaseComponentTelerikUploadBase<UploadFileInfo>TelerikUpload

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members TelerikUploadBase<UploadFileInfo>.OnAfterRenderAsync(bool)TelerikUploadBase<UploadFileInfo>.ClearFiles()TelerikUploadBase<UploadFileInfo>.OpenSelectFilesDialog()TelerikUploadBase<UploadFileInfo>.SelectFilesButtonTemplateTelerikUploadBase<UploadFileInfo>.EnabledTelerikUploadBase<UploadFileInfo>.MultipleTelerikUploadBase<UploadFileInfo>.AcceptTelerikUploadBase<UploadFileInfo>.AllowedExtensionsTelerikUploadBase<UploadFileInfo>.MinFileSizeTelerikUploadBase<UploadFileInfo>.MaxFileSizeTelerikUploadBase<UploadFileInfo>.IdTelerikUploadBase<UploadFileInfo>.CaptureTelerikUploadBase<UploadFileInfo>.DropZoneIdTelerikUploadBase<UploadFileInfo>.AriaDescribedByTelerikUploadBase<UploadFileInfo>.AriaLabelledByBaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()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)

OnInitialized()

Declaration

cs-api-definition
protected override void OnInitialized()

Overrides ComponentBase.OnInitialized()

UploadFiles()

Uploads all valid files.

Declaration

cs-api-definition
public void UploadFiles()