0
我有模式,有三个属性:的mvc .NET:通过一个HTTP POST在多个领域上传多个文件
IEnumerable<File> photos
IEnumerable<File>Logos
File Video
我可以张贴此模型到控制器通过POST方法?我如何配置获取控制器中的文件?
我有模式,有三个属性:的mvc .NET:通过一个HTTP POST在多个领域上传多个文件
IEnumerable<File> photos
IEnumerable<File>Logos
File Video
我可以张贴此模型到控制器通过POST方法?我如何配置获取控制器中的文件?
查看:
<input type="file" name="Photos">
<input type="file" name="Photos">
<input type="file" name="Logos">
<input type="file" name="Logos">
<input type="file" name="Video">
可以填充用JavaScript上传。
控制器:
[HttpPost]
public ActionResult Create(
ViewModel model,
IEnumerable<HttpPostedFileBase> Photos,
IEnumerable<HttpPostedFileBase> Logos,
HttpPostedFileBase Video)
{
...
}
我们也可以通过视图模型,这是更为清洁后上传的文件。详情请查看this。