Files not being attached to POST request (axios) while sending with Postman works

Solution 1:

Your "file" is in fact a FileList because you accept multiple files

You should extract them one by one:

dataArray.append("datafiles", uploadFile);

should be

// uploadFile is an HTML input element: <input type="file" id="myfileinput" multiple>

// loop through files
for (let i = 0; i < uploadFile.length; i++) {
    const file = uploadFile.item(i);
    dataArray.append("file" + i, file);
}

More information: https://developer.mozilla.org/en-US/docs/Web/API/FileList