Upload controller doesn't receive files

5 posts, 0 answers
  1. Jan Erik
    Jan Erik avatar
    24 posts
    Member since:
    Mar 2011

    Posted 30 Jan 2014 Link to this post

    I'm using the upload widget and have a problem receiving files server side in an mvc controller.

    Javascript code:
     $("#file-upload").kendoUpload({
                async: {
                    saveUrl: '@Url.Action("UploadFiles")',
                    autoUpload: false
                },
                upload: function(e) {
                }
            });

    Controller signature: public ActionResult UploadFiles(IEnumerable<HttpPostedFileBase> files)

    When I debug into the controller method files is null. If I debug into the upload event on the widget I see that it contains the files. Looking at fiddler I also see that the data is sent to the server.



  2. Jan Erik
    Jan Erik avatar
    24 posts
    Member since:
    Mar 2011

    Posted 30 Jan 2014 in reply to Jan Erik Link to this post

    Figured it out, the <input /> need to have the same  name as the parameter in the controller method.
  3. Kendo UI is VS 2017 Ready
  4. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 31 Jan 2014 Link to this post

    Hi Jan,


    I am glad that the issue is resolved. Do not hesitate to contact us if you experience further problems.

    Have a great day!

    Regards,
    Dimiter Madjarov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. chen
    chen avatar
    3 posts
    Member since:
    Jul 2013

    Posted 09 Mar in reply to Jan Erik Link to this post

    i encounter this problem also, can you please post the sample, 
  6. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 09 Mar Link to this post

    Hello chen,

    Could you elaborate which sample are you referring to?

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready