Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
Multiple file uploads using XMLHttpRequest() fails in IE11 and Edge

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>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!