Мне нужно загрузить несколько файлов формы MVC3.Но я не получаю переменную на сервере.Это мой код.
@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();
}
Но fileUpload == Null;