I have a array in jquery. And i have a file list in view. I want to put this file list into my array and pass my controller/action I find some ways but dont work. there is my jquery
var Data = new FormData();
$('input[data-fileid=1]').each(function () {
var FileData = $(this).get(0).files[0];
Data.append("Attachments", FileData);
});
var arr = {
Code: "examplecode",
Id: 1
FileList: Data
};
$.ajax({
data: JSON.stringify(arr),
url: '/Panel/PD',
datatype: 'json',
type: 'POST',
contentType: 'application/json; charset=utf-8',
});```
and I don't know how to keep this data in class.