Trying to upload using Kendo Upload UI with Web API

2 posts, 0 answers
  1. Melvis
    Melvis avatar
    1 posts
    Member since:
    Oct 2013

    Posted 15 Oct 2013 Link to this post

    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() };
                    }
                });
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 17 Oct 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
Back to Top