1
I’m editing the previous question.
This function
traverses a table with input file
and plays in a formData
but sent by fetch
at the asp.net core
is coming null
function uploadFiles() {
let inputFile;
let formData = new FormData();
jQuery('#tblDocumentosAnexos > tbody > tr').each(function () {
inputFile = jQuery(this).find('td').eq(2).children()[0].files[0];
formData.append("arquivos", inputFile, inputFile.name);
});
console.log(formData);
fetch('upload', {
method: 'POST',
body: formData
})}
Method in Asp.net core
[Route("upload")]
[HttpPost]
public void Upload(List<IFormFile> files)
{
}