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.
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
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
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
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
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
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