Discussions

Ask a Question
Back to All

Remove file list from FormData in Angular JS

var request = {
method: 'POST',
url: rootDir + abc/ffft',
data: formdata,
headers: {
'Content-Type': undefined
},
success: (function (d) {

        }),
        error: (function (d) {
           
        }),
        complete: function (d) {
            formdata.forEach(function (val, key, fD) {
                console.log(key);
                formdata.delete(key);
            });
            var files = formdata.getAll("file[]");
            console.log("file" + files);
            files.delete("file[]");
           
        }

this service not working in file delete