A status update - the HTML encoding is expected, I had missed a line in the code that does it, and it is now documented (commit and article where the update was made).
As for the Upload UI issue - this will require further research to make there isn't a vulnerability exposed through this. This is what this item will track. The file name will keep being encoded.
Regards,
Marin Bratanov
Progress Telerik
While this is reviewed, you can decode the file names in the component event handlers in case the HTML entities are a problem.
The file name is correct in the controller (meaning - there are no HTML entities in it), and with the code below there is only a small visual glitch in the specific file names in the Upload component itself. A screenshot is attached below that illustrates the results.
@inject NavigationManager NavigationManager
<TelerikUpload SaveUrl="@SaveUrl" RemoveUrl="@RemoveUrl"
OnSuccess="@OnSuccessHandler"
OnSelect="@OnSelectHandler"/>
@code {
// one way to define relative paths, put the desired URL here
// can be a full URL such as https://mydomain/myendpoint/save
public string SaveUrl => ToAbsoluteUrl("api/upload/save");
public string RemoveUrl => ToAbsoluteUrl("api/upload/remove");
public string ToAbsoluteUrl(string url)
{
return $"{NavigationManager.BaseUri}{url}";
}
async Task OnSuccessHandler(UploadSuccessEventArgs e)
{
var actionText = e.Operation == UploadOperationType.Upload ? "uploaded" : "removed";
foreach (var file in e.Files)
{
string decodedFileName = System.Net.WebUtility.HtmlDecode(file.Name);
Console.WriteLine($"The file {decodedFileName} has been {actionText} successfully");
}
}
async Task OnSelectHandler(UploadSelectEventArgs e)
{
// the file name is encoded here already
foreach (var item in e.Files)
{
string decodedFileName = System.Net.WebUtility.HtmlDecode(item.Name);
Console.WriteLine($"OnSelect: {decodedFileName}");
}
}
}
Regards,
Marin Bratanov
Progress Telerik