在MVC 3中上传动态文件时出错

问题描述:

尝试在MVC 3中创建动态文件上传,当我发布页面时只给出我选择文件的计数,但这会给我带来错误,因为我还要保存其他数据,尽管我没有任何文件文件上传。



任何人对此都有任何建议吗?

Try to create dynamic file upload in MVC 3, when I post the page only gives count where I choose the file but this will gives me error , because have to save other data also although I don't have any file in the file upload.

Any one have any suggestions on the same?

非常感谢你们身体。我在尝试时得到了答案。 HttpPostedFileBase [] objPostedFile获取数组中已发布文件的所有列表,以便我们可以遍历每个文件数组并将每个非空文件保存到数据库中。



感谢

Prakash Bhatta
Thank you very much every body. I get my answer while trying it. The HttpPostedFileBase[] objPostedFile take all list of posted file in array so that we can iterate it through each file array and save each non null file into the database.

Thank
Prakash Bhatta