File uploading in MVC
I have a form like this.
<form method="post" action="Home/ContactUs" enctype="mutlipart/form-data">
<input type="text" name="Subject"/>
<input type="file" name="file" id="fileUpload">
</form>
I must upload a file, and save it in some folder. When I choose a file,
and submit form, on form subbmiting calling the ContactUs action.There is
ContactUs action from Home controller.
public ActionResult ContactUs(HttpPostedFileBase file, ContactFormModel
model)
{
//other code
}
But HttpPostedFileBase file is null, and I havn't got any notions why. Can
you help me, please?
No comments:
Post a Comment