我需要從MVC3上傳多個文件。但是我沒有得到服務器上的變量。這是我的代碼。如何上傳多個文件MVC 3
@using (Html.BeginForm("Index","Register", FormMethod.Post, new { enctype = "multipart/form-data" })) {
@Html.ValidationSummary(true)
<table>
<tr>
<td class="label">@Resources.Global.exemploFotos</td>
<td><input type="file" name="file" class="multi" accept="gif|jpg" maxlength="3" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="@Resources.Global.enviar" /></td>
</tr>
</table>
}
控制器:
[HttpPost] public ActionResult Index(IEnumerable<HttpPostedFileBase> fileUpload, FormCollection collection)
{
return View();
}
但是文件上傳== NULL;
這是好的解決方案http://midnightprogrammer.net/post/Upload-Files-In-RAZOR-With-jQuery-Uploadify-Plugin.aspx – cpoDesign 2012-02-06 16:03:22