Remove a FileList item from a multiple “input:file” in HTML5

JavascriptWeb DevelopmentFront End Scripts

When there is a situation where we need to remove items from DOM’s through JavaScript, we cannot do so directly from FileList object. We need to assign the following to an array:

$('input:file#upload')[1].files

After that remove items from this array using splice or method of our choice and use that array.

Another way is to upload files with the help of HTML file uploader and then delete corresponding objects by using JavaScript.

raja
Published on 11-Apr-2018 13:49:14
Advertisements