title: Using HTML5 file (Multiple) control in asp.net
body: <p>I am looking for a way to perfectly manage the <code>&lt;input type="file" multiple="multiple"&gt;</code> tag of HTML 5 in my asp.net 3.5 project.
  I have done it before with a single control on page, but what if we have multiple upload controls on the same page. Please see my code:</p>
  
  <pre><code>protected void btnSave_Click(object sender, EventArgs e)
  {
  //---------Need to check if my upload control has files: Please suggest a perfect way 
  if (fupAttachment.PostedFile != null || fupAttachment.PostedFile.FileName != "" || fupAttachment.PostedFile.ContentLength&gt;0)//here is a problem, as it does not checks for a blank file upload control
  HttpFileCollection hfc = Request.Files;
              string strDirectory = Server.MapPath("~/") + "Mailer/" + hidCampID.Value;
              if (hfc.Count&gt;0)
              {
                  if (!System.IO.Directory.Exists(strDirectory))
                  {
                      System.IO.Directory.CreateDirectory(strDirectory);
                  }
                  if (System.IO.Directory.Exists(strDirectory))
                  {
                      for (int i = 0; i &lt; hfc.Count - 1; i++)
                      {
                          hfc[i].SaveAs(strDirectory + "/" + hfc[i].FileName.Replace(" ", "_"));
                      }
                  }
              }
       }
  }
  </code></pre>
  
  <p>My asp page is something like this:</p>
  
  <pre><code>//----this control is from which I want to multiple upload files
  &lt;input type="file" multiple="multiple" runat="server" id="fupAttachment" /&gt;
  
  // Another upload control is there which takes input when page loads
  &lt;asp:FileUpload ID="fupMailingList" runat="server" /&gt;
  </code></pre>
  
  <p>So, exactly my problem is that when page loads "fupMailingList" has taken a file, and then when I want to use my multiple upload control "fupAttachment", I am unable to check if it has any files or not, as <code>hfc</code> checks for all upload controls and it gets file in one of them. So, please tell me a way to check only "fupAttachment" control and then do my work correctly.</p>