title: Multiple file upload using single input file in html
body: <p>I need to upload files whatever i browse from one html input file element.  If i select a file first time using that file element and again changing that selection by picking some other file, finally i need to submit form by having that both file selection.</p>
  
  <pre><code>&lt;html&gt;
  
   &lt;script&gt;
       function loadFiles(){
          var form = document.getElementById("imageUploadForm");
          var file = document.getElementById("fileSelector");
          var mi = document.createElement("input");
          mi.setAttribute('type', 'file');
          mi.setAttribute('value', file.value);
          document.getElementById("imageUploadForm").innerHTML = form.innerHTML + mi;
          file.value = "";
       }
   &lt;/script&gt;
   &lt;form&gt;
      &lt;div id="imageUploadForm"&gt;
      &lt;input type="file" onchange="loadFiles()" id="fileSelector"/&gt;
      &lt;input type="submit" value="Upload"&gt;
      &lt;/div&gt;
   &lt;/form&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>