title: Binding HttpPostedFileBase using Ajax.BeginForm
body: <p>I have a form which binds a model and a file upload using the default binder for HttpPostedFileBase.</p>
  
  <p>This works fine when using Html.BeginForm(). However, I wanted to perform the same action using AJAX so I replaced this with Ajax.BeginForm() changing the parameters accordingly.</p>
  
  <p>The model still binds correctly, however I can't get the file upload to bind to the HttpPostedFileBase.</p>
  
  <p>This binds the model and the file upload:</p>
  
  <pre><code>&lt;% using (Html.BeginForm("MapUpdateColumns", "RepositoryAdmin", FormMethod.Post, new { id = "UpdateDataset", enctype = "multipart/form-data" })) {%&gt;
  </code></pre>
  
  <p>This only binds the model:</p>
  
  <pre><code>&lt;% using (Ajax.BeginForm("MapUpdateColumns", "RepositoryAdmin", new AjaxOptions { UpdateTargetId = "columnMappings" }, new { id = "UpdateDataset", enctype = "multipart/form-data" })) {%&gt;
  </code></pre>
  
  <p>The controller action:</p>
  
  <pre><code>public ActionResult MapUpdateColumns(DatasetViewModel model, HttpPostedFileBase sourceFile)
  </code></pre>
  
  <p>Should this be possible, and if so what am I doing wrong? Thanks.</p>