title: MVC Model validation on "HttpPostedFileWrapper"
body: <p>Can someone help me with model validation on a HttpPostedFileWrapper object?</p>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>[Required(AllowEmptyStrings = false)]
  public HttpPostedFileWrapper BlahFile { get; set; }
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>   [HttpPost]
      public ActionResult LoadBlahData(BlahModel blahModel) 
      {
          if (!ModelState.IsValid)
              return RedirectToAction("Index");
      }
  </code></pre>
  
  <p><strong>cshtml:</strong></p>
  
  <pre><code>@using (Html.BeginForm("LoadBlahData", "Admin", FormMethod.Post, new { @class = "blahhForm", enctype = "multipart/form-data", id = "uploadBlah" }))
  {
      &lt;fieldset&gt;
          &lt;legend&gt;Upload Blah Information&lt;/legend&gt;
          @Html.LabelFor(x=&gt;x.BlahFile, "Upload Blah file:")
          &lt;input size="26" class="uploader" type="file" name="BlahFile" /&gt;
          &lt;p&gt;&lt;input class="ttButton" type="submit" value="Load Stuff" /&gt;&lt;/p&gt;
      &lt;/fieldset&gt;
  }
  </code></pre>
  
  <p><strong>Problem:</strong></p>
  
  <ol>
  <li>Cannot see the "data-val*" attributes being added to the html.</li>
  <li>Does not set the unobtrusive validation off (red border on input box) </li>
  </ol>
  
  <p><strong>Notes:</strong></p>
  
  <ol>
  <li>Other items in the Model are working fine with validation, its only the <code>&lt;input type="file"/&gt;</code> that seems to be having problems.</li>
  <li>Comes into the action method fine - (i.e - i can access the InputStream if i want).</li>
  <li>All scripts are referenced correctly (its working on normal text input's)</li>
  </ol>
  
  <p>Thanks in advance,</p>