title: MVC 3 input file always null
body: <p>I added an input file field but it's always null on the controller. What am I missing?</p>
  
  <p>Here's the code for both my view and controller.</p>
  
  <p>view:</p>
  
  <pre><code>...
  @using (Html.BeginForm())
  {
      ...
  
      &lt;input type=file name="file" id="file" class="post-attachment" /&gt;
  
      ...
  }
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>[HttpPost]
  public ViewResult _Details(HttpPostedFileBase file, ViewTopic viewTopic, string SearchField, string submitBtn)
  {
      // save file to server
      if (file != null &amp;&amp; file.ContentLength &gt; 0)
      {
          var fileName = DateTime.Today.ToString("yy.MM.dd") + Path.GetFileName(file.FileName);
          var path = Path.Combine(Server.MapPath("~/Attachments"), fileName);
          file.SaveAs(path);
      }
  
  ...
  }
  </code></pre>