New to Telerik UI for ASP.NET Core? Start a free 30-day trial
Display Directory Name and File Size in Upload
Environment
Product | Telerik UI for ASP.NET Core Upload |
Progress Telerik UI for ASP.NET Core version | Created with the 2022.1.412 version |
Description
How can I display the directory name and the total size of its content when working with the Telerik UI for ASP.NET Core Upload?
Solution
- Hide the file list menu through the
.ShowFileList()
configuration method. - Subscribe to the
Select
event. - Get both the directory name and total file size in the
Select
event handler, and append them to the widget wrapper.
Index.cshtml
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("Directory_Upload_Chunk_Save", "Home")
.Remove("Directory_Upload_Remove", "Home")
.ChunkSize(11000)
)
.ShowFileList(false)
.Directory(true)
.DirectoryDrop(true)
.Events(e=>e.Select("onSelect"))
.Validation(validation =>
{
validation.MaxFileSize(20000000);
})
)
For the complete implementation of the suggested approach, refer to the following Telerik REPL example.