title: How to set boundary while using XmlHttpRequest and FormData
body: <p>I am trying to set the boundary correctly in the header while using FormData to post the XmlHttpRequest:</p>
  
  <pre><code>xhr.open("POST",url);
  xhr.setRequestHeader("Content-type","multipart/form-data; boundary=...");
  
  var formData = new FormData();
  formData.append("filename", inputId.files[0]);
  formData.append(...);
  
  xhr.send(formData);
  </code></pre>
  
  <p>How do I get the boundary to be set in the request header here. I saw the request being set, the boundary is somehow created in the request. But the server has no idea on how to interpret it.</p>