html代码 form表单中 加N个file类型的input
<input name="file1" type="file" />
<input name="file2" type="file" />
<input name="file3" type="file" />public ActionResult Save()
{
if(Request.Files.Count > 0)
{
string yourfilepath = "这里是你的存放路径";
if(Request.Files["file1"].ContentLength > 0)
{
Request.Files["file1"].Save(yourfilepath);
}
if(Request.Files["file2"].ContentLength > 0)
{
Request.Files["file2"].Save(yourfilepath);
}
if(Request.Files["file3"].ContentLength > 0)
{
Request.Files["file3"].Save(yourfilepath);
}
}
return View();
}
纯手工敲,记得你的悬赏哦。