@(Html.Kendo().Upload()
.Name("File")
.Async(a => a
.AutoUpload(true))
.Files(
files =>
{
if (Model.File != null)
{
files.Add().Name(Model.FileName).Extension(Model.FileExtension).Size((long)Model.FileSize);
}
}
)
.Events(e => e.Select("onSelect"))
.Multiple(false)
)
I saw that there was a demo for initial files in mvc but that disappeared in the asp.net core demos.
Thanks
5 Answers, 1 is accepted
Attached you will find a small sample implementing an Upload HTML helper with initial files configured in .Net Core app.
Regards,
Veselin Tsvetanov
Progress Telerik

I Initially wanted a 'batch' mode upload control that also had an initial files list and I wanted to display thumbnails so the user can see what file is already uploaded when they open the form. I actually did get this working 100%. But, unfortunately I had to use async mode with server side functions that never get called, as I did not want to save or remove the image until the form us submitted. I think this has got to be a standard problem that most developers have with this. I had to write quite a lot of JS to get it to work the way I want it, and set boolean flags for images to be removed on the server on submit:
@(Html.Kendo().Upload()
.Name("File")
.Async(a => a
.Save("SaveAttachment", "Admin", new { id = Model.Id }) //functions that don't actually get called
.Remove("RemoveAttachment", "Admin", new { id = Model.Id, lang = "en" })
.AutoUpload(false))
.Files(
files =>
{
if (Model.CourseImage != null)
{
files.Add().Name(Model.FileName).Extension(Model.FileExtension).Size((long)Model.FileSize);
}
)
.Events(e => e.Select("cba.onSelect").Remove("cba.onRemove"))
.Multiple(false)
)
Yes, that is correct, the Upload widget could be configured with initial files only when it is in its Asyc() mode. Having that said, you have correctly approached this case, so you will be able to update the state of the files on submit.
Regards,
Veselin Tsvetanov
Progress Telerik

For those that are having the same issue, I've created a how to article located here: Kendo Upload Batch mode.
There is also source code to download, to get started quickly!
Hello Chris,
Thank you for sharing your full implementation with the community. I am sure it would be of great help for other developers too. As a small token of gratitude for your effort, I have just updated your Telerik points.
Regards,
Veselin Tsvetanov
Progress Telerik