I have fritten following tool to upload multiple files to a api service and it works fine in chrome and firefox, but it gives me a bad request error in IE11 and edge, I believe, the ccode doesn't pass the files with required parameter
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<label for="queuemanagername">QUEUE MANAGER NAME:</label><br>
<input type="text" id="queuemanagername" name="queuemanagername" value=""><br>
<label for="queuename">queue name:</label><br>
<input type="text" id="queuename" name="queuename" value=""><br>
<input type="file" id="inpFile" multiple><br>
<label for="comment">Comment:</label><br>
<textarea id="comment" name="comment" rows="4" cols="50"></textarea><br>
<button id="btnUpload"> Upload files</button>
<script>
const inpFile = document.getElementById("inpFile");
const btnUpload = document.getElementById("btnUpload");
btnUpload.addEventListener("click",function () {
//var xhr = new XMLHttpRequest();
var formData = new FormData();
xhr.open("POST", "http://localhost:8080/uploadFile", true);
xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');
for (const file of inpFile.files) {
formData.append("multipleFiles",file);
}
xhr.send(formData);
});
</script>
</body>
</html>