title: HttpPostedFile return null value?
body: <p>I have a form sends POST data to Action, and a Model has HttpPostedFile field, but when I send the Form data to Action I just get the null value HttpPostedFile Field
  .</p>
  
  <p><strong>This is my Model:</strong> </p>
  
  <pre><code>public class MemberModel
  {
      [DisplayName("Member Name")]
      public string Name { get; set; }
      [DisplayName("Telephone / Mobile Number")]
      public string PhoneNumber { get; set; }
      [DisplayName("Upload File")]
      public string ImagePath { get; set; }
      public HttpPostedFile ImageFile { get; set; }
  }
  </code></pre>
  
  <p><strong>This is my Action:</strong> </p>
  
  <pre><code>public ActionResult ContactForm(MemberModel membervalues)
      {
          //Use Namespace called :  System.IO
          string FileName = Path.GetFileNameWithoutExtension(membervalues.ImageFile.FileName);
  
          //To Get File Extension
          string FileExtension = Path.GetExtension(membervalues.ImageFile.FileName);
  
          //Add Current Date To Attached File Name
          FileName = DateTime.Now.ToString("yyyyMMdd") + "-" + FileName.Trim() + FileExtension;
  
          //Get Upload path from Web.Config file AppSettings.
          string UploadPath = ConfigurationManager.AppSettings["UserImagePath"].ToString();
  
          //Its Create complete path to store in server.
          membervalues.ImagePath = UploadPath + FileName;
  
          //To copy and save file into server.
          membervalues.ImageFile.SaveAs(membervalues.ImagePath);
  
          //To save Club Member Contact Form Detail to database table.
  
  
          var db = new ClubMemberDataClassesDataContext();
  
          tblMember _member = new tblMember();
  
          _member.ImagePath = membervalues.ImagePath;
          _member.MemberName = membervalues.Name;
          _member.PhoneNumber = membervalues.PhoneNumber;
  
          db.tblMembers.InsertOnSubmit(_member);
          db.SubmitChanges();
          return View();
      }
  </code></pre>
  
  <p><strong>This is my Form View:</strong> </p>
  
  <pre><code>&lt;div class="form-group"&gt;
      @Html.LabelFor(model =&gt; model.ImagePath, htmlAttributes: new { @class = "control-label col-md-2" })
      &lt;div class="col-md-10"&gt;
          &lt;input type="file" name="ImageFile" required /&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>And this result while I'm trying upload Image File:</strong> 
  <a href="https://i.stack.imgur.com/XpnxI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XpnxI.png" alt="enter image description here"></a></p>