在MVC 3中上传动态文件时出错 [英] Error while dynamic file upload in MVC 3

查看:93
本文介绍了在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


这篇关于在MVC 3中上传动态文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆