title: Upload multiple files using HttpFileCollectionBase issue with C# and MVC3
body: <p>I created a controller which save files.</p>
  
  <p>The below code is a part of that Controller:</p>
  
  <pre><code>if ( Request.Files.Count != 0 ) {
        HttpFileCollectionBase files = Request.Files;
  
        foreach ( HttpPostedFileBase file in files ) {
              if ( file.ContentLength &gt; 0 ) {
                 if ( !file.ContentType.Equals( "image/vnd.dwg" ) ) {
                    return RedirectToAction( "List" );
                 }
              }
           }
   }
  </code></pre>
  
  <p>in ASPX page is simple:</p>
  
  <pre><code>&lt;input type="file" name="file" /&gt;
  &lt;input type="file" name="file" /&gt;
  ...// many inputs type file
  </code></pre>
  
  <p>The problem is <code>foreach</code> because it returns an error like (I know because I run in Debug mode and placed breakpoint at foreach statement): </p>
  
  <pre><code>Unable to cast object of type 'System.String' to type 'System.Web.HttpPostedFileBase'.
  </code></pre>
  
  <p>What is my mistake ?</p>