Answer the question
In order to leave comments, you need to log in
Why can't I send the file?
The view has this form:
@using (Html.BeginForm("Upload", "Home", FormMethod.Post))
{
<input type="file" name="1CClientBankExchange" accept="text/plain" required />
<input type="submit" />
}
[HttpPost]
public ActionResult Upload(HttpPostedFile file)
[HttpPost]
public ActionResult Upload()
{
var file = Request.Files["1CClientBankExchange"];
}
Answer the question
In order to leave comments, you need to log in
The example uses HttpPostedFileBase (there is some confusion about HttpPostedFile). Educational program on the topic of loading files in ASP.NET MVC.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question