title: Upload multiple files from two fileupload controls in asp.net 4.0 withou using postedfiles property of file upload control
body: <p>i have two file upload controls
   
  
  And this is the code to save multiple files
  c#
   string filepath = Server.MapPath("~//Files/Documents/test/");
          HttpFileCollection uploadedFiles = Request.Files;</p>
  
  <pre><code>    //Span1.Text = string.Empty;
  
      for (int i = 0; i &lt; uploadedFiles.Count; i++)
      {
          HttpPostedFile userPostedFile = uploadedFiles[i];
  
          try
          {
              if (userPostedFile.ContentLength &gt; 0)
              {
                  Response.Write(userPostedFile.FileName);
  
                  userPostedFile.SaveAs(filepath  + Path.GetFileName(userPostedFile.FileName));                  
                  //Span1.Text += "Location where saved: " +   filepath + "\\" +   Path.GetFileName(userPostedFile.FileName) + "&lt;p&gt;";
              }
          }
  
          catch (Exception Ex)
          {
              //Span1.Text += "Error: &lt;br&gt;" + Ex.Message;
          }
      }
  </code></pre>