This is a migrated thread and some comments may be shown as answers.

Example Async Upload usage in .net Core

7 Answers 532 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Richard Lewis
Top achievements
Rank 1
Richard Lewis asked on 12 Feb 2017, 03:40 PM

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

Sort by
0
Richard Lewis
Top achievements
Rank 1
answered on 12 Feb 2017, 03:42 PM

Just found it, must be blind...

http://demos.telerik.com/aspnet-core/upload/async

 

0
Richard Lewis
Top achievements
Rank 1
answered on 12 Feb 2017, 04:16 PM

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);
}

0
Nencho
Telerik team
answered on 15 Feb 2017, 03:57 PM
Hello Richard,

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
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tim
Top achievements
Rank 1
answered on 22 Jan 2018, 09:35 AM

The .NET Core document and examples are still woefully out of date!

https://docs.telerik.com/aspnet-core/helpers/html-helpers/upload

 

0
Nencho
Telerik team
answered on 25 Jan 2018, 08:02 AM
Hello Tim,

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
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Rick
Top achievements
Rank 2
answered on 30 Jan 2018, 10:52 PM
For example, I want to use the taghelper for the upload control. Looking at the doc page: https://docs.telerik.com/aspnet-core/helpers/tag-helpers/upload does not show me how to set the controller and action to call for saving the doc. It doesn't show me all the available parameters/tags that I can use. The docs should be COMPLETE. Very frustrating.
0
Nencho
Telerik team
answered on 02 Feb 2018, 02:32 PM
Hello Rick,

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="" />
Generally, for the nested objects we've created a subtags to define the options events etc. That being said, when in razor syntax you have 
//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
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Upload
Asked by
Richard Lewis
Top achievements
Rank 1
Answers by
Richard Lewis
Top achievements
Rank 1
Nencho
Telerik team
Tim
Top achievements
Rank 1
Rick
Top achievements
Rank 2
Share this question
or