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

Trying to upload using Kendo Upload UI with Web API

1 Answer 382 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Melvis
Top achievements
Rank 1
Melvis asked on 15 Oct 2013, 06:11 PM
I am trying to use Kendo Upload UI with Web API. I have the below signature in my web api controller, but somehow the POST is not working. It works fine with
MVC controller, but I need it to work with Web API. I also include the call made from the UI.

 public void AddFile(IEnumerable<HttpPostedFileBase> files, string id)
{
}  
            $("#files").kendoUpload({
                async: {
                    saveUrl: '/api/my/addfile',
                    autoUpload: true
                },
                upload: function (e) {
                    e.data = { id: $('#test').val() };
                }
            });

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 17 Oct 2013, 08:17 AM
Hello,

As far as I understand Web API will not automatically decode multi-part (upload) requests. It's up to the developer to do that:
http://blogs.msdn.com/b/henrikn/archive/2012/03/01/file-upload-and-asp-net-web-api.aspx

I hope this helps.

Regards,
T. Tsonev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Upload
Asked by
Melvis
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or