I cannot find a way to populate the kendo upload control so the old HttpPostedFileBase gets reposted on the next form post. Is this possible?
Thanks,
Logan
5 Answers, 1 is accepted
Hello Logan,
During the initialization of the widget we are checking if the value of the underlying input element is not empty i.e. if there are any previously selected files in order to load them directly. If you assure that the value of input is retained at your end, the files will be loaded in the list.
Regards,Dimiter Madjarov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Hello Logan,
If the Model State is not cleared and the same view is returned, the value of the form fields is retained. If this is the case at your end, the Upload widget will detect that value of the underlying input is not empty and display the file to the list.
Regards,Dimiter Madjarov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

We are experiencing the same issue as above, using Q2 2015 release.
The upload control is rendered via en editor template:
@model HttpPostedFileWrapper
@{
var fileUpload = Html.Kendo()
.Upload()
.Name(ViewData.TemplateInfo.HtmlFieldPrefix)
.Multiple(false)
.HtmlAttributes(new { accept = ".png,.jpg,.gif" });
}
@if (Model != null && File.Exists(Model.FileName))
{
var fileInfo = new FileInfo(Model.FileName);
fileUpload.Files(f => f.Add()
.Name(fileInfo.FullName)
.Size(fileInfo.Length)
.Extension(fileInfo.Extension));
}
@fileUpload
This works absolutely fine in normal circumstances. However, if a model state error is picked up and the view returned, the upload control has no files. As you can see in the above example we even made an attempt to add in the files manually if the model property has data - this isn't working either.
I can also confirm that the modelstate is not being cleared in the controller method.
Any ideas?
Regards,
Paul
Hello Paul,
We cannot state for sure what is the reason for the undesired behavior. Please send us an isolated runnable example that demonstrates the case here or in a separate support ticket, so we could take a look.
Regards,Dimiter Madjarov
Telerik