title: Multiple file inputs
body: <p>I am using Asp.net and requirement specifies i use html input to post files to server rather than asp:fileupload.[ Reason : Add more html input file controls similar to CPanel file manager.(i.e) clicking on link adds another file input from which user can select another file*<em>.But when ever i post back Request Files collection is always empty.</em>* 
  HTML FORM:</p>
  
  <pre><code>&lt;form method="post" enctype="multipart/form-data" action="documents.aspx"&gt;
  &lt;div&gt;
      &lt;input type="file" name="attachment" id="attachment" onchange="validate(this)" /&gt;
      &lt;span class="none"&gt;Filename should be within (1-25) letters long. Can Contain only letters
          &amp; numbers&lt;/span&gt;
      &lt;div id="moreUploads"&gt;
      &lt;/div&gt;
      &lt;div id="moreUploadsLink" style="display: none;"&gt;
          &lt;a href="javascript:addFileInput();"&gt;Attach another File&lt;/a&gt;&lt;/div&gt;
          &lt;input type="submit" id="btnSubmit" /&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>var upload_number = 2;function addFileInput() {
  try {
      var fileUpload = document.getElementById("attachment");
      var elemSpan = nextElement(fileUpload).cloneNode(true);
      var elemDiv = document.getElementById("moreUploads");
      var d = document.createElement("div");
      var file = document.createElement("input");
      file.setAttribute("type", "file");
      file.setAttribute("id", "attachment" + upload_number);
      file.setAttribute("onchange", "validate(this)");
      d.appendChild(file);
      d.appendChild(elemSpan);
      elemDiv.appendChild(d);
      upload_number++;
  } catch (err) {    alert(err);}}
  </code></pre>
  
  <p>the validate(this) is a function that validates file types on client.When validation succeeds then the link to add more file inputs is enabled. Could someone throw somelight on this.</p>