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" />
    }

 

posted @ 2013-10-30 14:41  二师弟tl  阅读(216)  评论(0编辑  收藏  举报