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

How to return a string value from upload web api controller

1 Answer 700 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 16 Mar 2020, 02:44 PM

Kendo upload ui control works if the web api controller return empty string, but it errors out of try to return any kind of non-empty string value.

Is there way to return a valid string value that can be processed on the client side?

 

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 18 Mar 2020, 08:47 AM

Hi Edward,

The reported issue is related to the configuration of the controller rather than to the Kendo UI for Angular Upload component. Please check the following article demonstrating how to return a string on success:

https://stackoverflow.com/questions/35344226/return-a-string-in-web-api-2

Basically the controller should return something like the following:

            return Ok("some test string");

I further checked that approach in the following project:

https://github.com/telerik/kendo-angular/tree/master/examples-standalone/aspnetcore-upload

and it works as expected. I hope the provided information helps. Please let me know in case further assistance is required for this case. Thank you.

Regards,
Svetlin
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Upload
Asked by
Edward
Top achievements
Rank 1
Answers by
Svet
Telerik team
Share this question
or