Reputation: 6814
In html we can select multiple files at once using file input control. But when i selected a file second time previous files overwritten by the newly selected files.
My question is, Can we able to keep existing file selections while selecting new files?
Upvotes: 1
Views: 464
Reputation: 6814
I didn't get any snippet related to this, seems most people doesn't require this kind of functionality. So i did it myself.
clone
method. This cloned input control set to hidden and current input control holds latest files.I doubt how well this method works in older browsers, but current chrome and firefox executes it well.
Upvotes: 1
Reputation: 2468
I think your problem is that you give the same name to the different <input> tags.
<div id="selectFiles">
<input type='file' name='userFile1'>
<input type='file' name='userFile2'>
<input type='file' name='userFile3'>
<input type='file' name='userFile4'>
</div>
Upvotes: 0