If I understand your problem correctly, you want to keep selecting files by clicking the button multiple no. of times.
For that, you can do something like this:
- Add onchange event for input-file
- Maintain a hashtable (simply, an object) to hold all the selected
files.
- Inside onchange event handler fill the hash table. (Note: depending
upon your requirement, you may want to change how the 'key' is created for this
hashtable).
<input type="file" multiple="multiple" id="fname" onchange="pp()" />
<script type="text/javascript">
var x={};
function pp()
{
var k = document.getElementById("fname");
for (var i = 0; i < k.files.length; i++){
x[k.files[i].name]=k.files[i];
}
console.log(x);
}
</script>