Please provide an example of Async file upload in Razor using .net Core. The only examples I can find use the HttpPostedFileBase which is replaced in .net core.
http://demos.telerik.com/aspnet-mvc/upload/async
Please post a how to, or direct me to an appropriate existing document guide on how to implement this in .net core. Is this supported yet? If so where can I find the correct documentation with demos and example code?
Thanks
7 Answers, 1 is accepted
Just found it, must be blind...
http://demos.telerik.com/aspnet-core/upload/async
However, perhaps the code should be updated as the 'SaveAs' method is no longer available. Perhaps something like this?
using (var fileStream = new FileStream(destinationPath, FileMode.Create))
{
await file.CopyToAsync(fileStream);
}
I am happy to see that you were able to find the needed demo and implementation. As for the SaveAs method - your observations are absolutely correct and this will be fixed as soon as possible.
As a token of gratitude for pointing that out, I have updated your Telerik Points.
Thank you for your feedback!
Regards,
Nencho
Telerik by Progress
The .NET Core document and examples are still woefully out of date!
https://docs.telerik.com/aspnet-core/helpers/html-helpers/upload
We are constantly trying to revise and update our documentation. Could you please share a bit more of your feedback and let us know, what you expect to see and what you have struggled to implement, that the documentation failed to assist you with?
Regards,
Nencho
Progress Telerik
Thank you for your feedback. We absolutely agree!
We are currently working on concept to create a API Reference for the TagHelpers and they are up to come.
As for the AutoComplete in particular, you can use the async section and specify the save-url:
<
async
auto-upload
=
"true"
save-url
=
""
remove-url
=
""
/>
//razor
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("Save", "Upload")
.Remove("Remove", "Upload")
.AutoUpload(true)
)
)
//taghelper
<
kendo-upload
name
=
"files"
>
<
async
auto-upload
=
"true"
save-url
=
"~/home/save"
remove-url
=
"~/home/remove"
/>
</
kendo-upload
>
As for the events, they are registered with on prefix:
https://docs.telerik.com/aspnet-core/helpers/tag-helpers/tag-helpers#handling-widget-events
Regards,
Nencho
Progress Telerik