1 year ago

#49739

test-img

user5392173

jquery. update filelist after splice

i have my piece of code of removing items in filelist. first im done with converting my filelist to another array. and there i made my splice function. my problem here is how to get update the existing filelist after the splice function i made. i want to assign back the array i made to the filelist.

// existing filelist

var fileList = [];

var file_list = $('#fileupload').get(0).files;
var fileListArr = Array.from(file_list)

fileListArr.splice(i, 1)

for (var x = 0; x < fileListArr.length; x++)
{
    fileList.push($('#fileupload')[0].files[x]);
}

console.log($('#fileupload')[0], 'newFiles')

i want to update my existing filelist here. right now nothing happens. thank you folks

javascript

jquery

arrays

filelist

0 Answers

Your Answer

Accepted video resources