I used FormData to get and send form to backend.
I want to send multiple file without using multiple property of input tag (because of work purpose)
Here is my code
area += '<div id="select-file-'+ newFileIndex + index + '">' +
'<input type="file" name="part_kpi[' + index + '][mid_year_review_employee_file][]" id="file_' + nameInput + newFileIndex + i + '" placeholder="" onchange="showFile(this,' + index + ',' + newFileIndex + ',\'' + nameInput + '\')">' +
'<label for="file_' + nameInput + newFileIndex + i + '" class="custom-file-upload">Choose Files</label>' +
'</div>'
$('#attachment-area' + index).html(area);
That mean whenever I upload a file, I will regenerate Choose Files button
But if I use $('#attachment-area' + index).html(area); the Form Data did not send my file to BE (if I comment out this line it sent normally)
What I should do?