MVC上传文件示例
[HttpPost] public void SaveFile(FormCollection form) { var c = Request.Files.Count; var f = Request.Files[0]; }
@using (Html.BeginForm("SaveFile", "Test", FormMethod.Post, new { id = "form1", enctype = "multipart/form-data" })) { <input id="File2" name="File2" type="file" /> <input id="File1" name="File1" type="file" /> <input id="Submit1" type="submit" value="submit" /> }