Get a response from controller invoked by kendo-upload

1 Answer 102 Views
FileSelect
Francesco
Top achievements
Rank 1
Francesco asked on 28 Jun 2022, 11:04 AM

Hi, I would like to get a structured response from a controller invoked by a component. in the UploadsModule module (kendo-upload).

I send a text file that is processed server side.

I would like to send the processed object back to the component that sent the original file?

Could be done?

 

Thanks for your help,

Francesco Aperti

1 Answer, 1 is accepted

Sort by
0
Lance | Senior Manager Technical Support
Telerik team
answered on 30 Jun 2022, 09:40 PM

Hi Francesco,

In short, yes. However, the actual implementation is up to your API controller, not the Kendo Upload.

As one simple example, take a look at how our Kendo Upload demo's ASP.NET Web API controller returns an empty string. You could return more information in that string.

If you're using Angular for your backend, then you'll need to specifically craft an HttpResponse object with a 200 status code and populate the statusText parameter. We do not have an example of this because it's outside the scope of the Kendo controls themselves, but here's a screenshot of such a setting:

Once your server-side is configured to return something in the 200 status HttpResponse, then you can process in the result in the Kendo Upload's Success event (e.response is the HttpResponse from your WebAPI)

Resources

For more information and to review the events available to you, please see the following items:

  • The Kendo Upload's Events demo (so you can see these events being used, please select and upload a file)
  • The Kendo Upload's API Reference (specifically, check out the list of events and their event args)

Wrapping Up

Although we do not have an example of a server-side API Controller that returns an object for further processing, you should have enough information there to experiment with and move forward.

I hope this was helpful information!

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
FileSelect
Asked by
Francesco
Top achievements
Rank 1
Answers by
Lance | Senior Manager Technical Support
Telerik team
Share this question
or