Unplanned
Last Updated: 21 Sep 2025 19:20 by ADMIN
Quentin
Created on: 22 Apr 2024 10:21
Category: Upload
Type: Feature Request
9
Call the RemoveUrl endpoint for removing Initial Files

When the Upload has Initial Files, the RemoveUrl endpoint is not called when the user removes them from the UI. 

===

TELERIK EDIT

The current workaround is to call the RemoveUrl in the Upload's OnRemove event handler. This is also applicable when you need to send additional custom data with the file name.

.razor file

@inject HttpClient HttpClient

<TelerikUpload OnRemove="@OnUploadRemove" RemoveUrl="@RemoveUrl" />

@code {
    private string RemoveUrl { get; set; } = "api/upload/remove";

    private async Task OnUploadRemove(UploadEventArgs args)
    {
        // code for non-initial files
        // send optional custom data to the controller
        args.RequestData.Add("requestKey", "custom value");

        // code for initial files
        // call the RemoveUrl
        if (args.Files.First().Status == UploadFileStatus.Blank)
        {
            var multipartContent = new MultipartFormDataContent();

            multipartContent.Add(new StringContent(args.Files.First().Name), "files"); // "files" must match the RemoveField value
            multipartContent.Add(new StringContent("requestKey"), "custom value"); // send optional custom data to the controller

            await HttpClient.PostAsync(RemoveUrl, multipartContent);
        }
    }
}

 

Program.cs

builder.Services.AddHttpClient();

 

2 comments
ADMIN
Dimo
Posted on: 21 Sep 2025 19:20

Hello David,

"Unplanned" means that the feature request is confirmed as valid and can be implemented, but we haven't scheduled it for a specific release.

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

David
Posted on: 19 Sep 2025 20:01
I just ran into this issue myself. I see its marked as "Unplanned" does that mean this is working as intended and will not be changed? If so, please update the documentation as this is not intuitive.