Seeing this example, how can I pass along extra values in the data that is posted back to the server, along with the file(s)? Custom model?
4 Answers, 1 is accepted
Hello Randal,
You can send additional data in the upload event through the e.data object. Please refer to this How-To article demonstrating how to achieve that.
Let me know if you have any questions.
Regards,
Martin
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.

Trying to use this example but with Razorpages
https://demos.telerik.com/aspnet-core/upload/asyncupload
When calling the save method, what does one use for the controller name if using Razorpages?

I think I managed to figure out a solution, but I would benefit by having some notes somewhere on each control, or even a seperate area specific to Razorpages, as others have requested.
In my case, I replaced the call to Save with SaveURL, eg.
The mvc example...
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("Async_Save", "Upload")
.Remove("Async_Remove", "Upload")
.AutoUpload(true)
)
becomes this for using in a Razorpage...
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.SaveURL("/TestUpload?handler=AsyncSave")
.AutoUpload(true)
)
Where "TestUpload" is the name of the Razorpage.
Then, your handler needs to be
public async Task<ActionResult> OnPostAsyncSave(IEnumerable<IFormFile> files)
Hello Randal,
I am glad that you were able to modify the example for Razor Pages thank you for sharing the way to do it. As for the documentation, we are making an effort in that direction to include Razor Pages articles and examples.
Regards,
Martin
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.