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

Upload/Submit HttpPostedFileBase has zero files

1 Answer 57 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 22 Apr 2014, 07:39 PM
I am using the "Basic usage" of the Upload control in ASP.NET MVC and Internet Explorer version 9.0.8112.16421

After I select the file to upload and click "Submit", my Submit() action is indeed called, but "IEnumerable<HttpPostedFileBase> files" contains zero files in the called method:

public ActionResult Submit(IEnumerable<HttpPostedFileBase> files)
{
:
:
}

How can I get the actual files to be uploaded?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 23 Apr 2014, 10:24 AM
Hi Richard,

Could you please assure whether the files parameter is empty or it is null? If it's the second case, then the most probable reason is that the name attribute of the input type="file" element is different. It should also be called files, as this is way that the model binder works.

If that is not the case, could you please send me a small example project, which demonstrates the issue, so I could inspect it locally?

Regards,
Dimiter Madjarov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Upload
Asked by
Richard
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or