title: Request.File.Count is still set to 1 when File Upload in ASP.Net MVC encountered a previous error
body: <p>I'm developing a form in ASP.Net MVC where it contains an <code>&lt;input type="file" /&gt;</code> which is not mandatory in a form.</p>
  
  <p>In my controller, I have this code:</p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
  [ValidateInput(false)]
  public ActionResult Create(FormCollection collection) {
          ...
  
          //get uploaded file
          if (Request.Files.Count &gt; 0)
          {
              file = Request.Files["imgFileUpload"];
              if (file.ContentLength == 0)
              {
                  throw new InvalidOperationException("File contents are empty");
              }
              ...
          } 
          ...
  }
  </code></pre>
  
  <p>Now, when a user uploads a file that has no content, the form would raise an exception and prompt the user about it -- which is expected.</p>
  
  <p>Now, if a user decided that they are not going to upload any file anymore and click the submit button, the previous exception would still show, which is quite bizzare.</p>
  
  <p>I've tried checking the values for <code>Request.Files</code> and noticed that its count is still set to 1... it still thinks that there is a file there, given that the user has not placed any file on the <code>&lt;input type="file" /&gt;</code> control.</p>
  
  <p>Has anybody encountered this? If so, what steps did you do to prevent from re-executing the previous exception again?</p>
  
  <p>Thank you so much!</p>