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

Upload controller doesn't receive files

8 Answers 549 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Jan Erik
Top achievements
Rank 2
Jan Erik asked on 30 Jan 2014, 07:20 PM
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.



8 Answers, 1 is accepted

Sort by
0
Jan Erik
Top achievements
Rank 2
answered on 31 Jan 2014, 01:37 AM
Figured it out, the <input /> need to have the same  name as the parameter in the controller method.
0
Dimiter Madjarov
Telerik team
answered on 31 Jan 2014, 08:33 AM
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!
0
chen
Top achievements
Rank 1
answered on 09 Mar 2016, 01:36 PM
i encounter this problem also, can you please post the sample, 
0
Dimiter Madjarov
Telerik team
answered on 09 Mar 2016, 01:50 PM

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!
 
0
Landon
Top achievements
Rank 1
answered on 10 Apr 2018, 06:22 PM

Thank you so much! This little detail had me stuck for far too long... 

 

-Landon Hulcy

0
Christos
Top achievements
Rank 1
answered on 16 Feb 2020, 09:43 PM
Thanks Jan - your suggestion solved my problem.
0
Leandro
Top achievements
Rank 1
answered on 30 Jul 2020, 10:54 AM

Hi, I'm having the same problem. I already check the name input matching the controller parameter, but still getting a null HttpPostedFileBase. I'm out of new solutions, so any help will be appreciated.

Please, find my project in attach. I try via normal save and chunck mode, without sucess. 

Best regards, 

Leandro Alves

0
Martin
Telerik team
answered on 03 Aug 2020, 09:00 AM

Hello Leandro,

I saw that you were able to resolve the problem in this forum thread you opened on the subject. If you are experiencing any further problem, please let us know.

Regards,
Martin
Progress Telerik

Tags
Upload
Asked by
Jan Erik
Top achievements
Rank 2
Answers by
Jan Erik
Top achievements
Rank 2
Dimiter Madjarov
Telerik team
chen
Top achievements
Rank 1
Landon
Top achievements
Rank 1
Christos
Top achievements
Rank 1
Leandro
Top achievements
Rank 1
Martin
Telerik team
Share this question
or