XMLHttpRequest to Microsoft Graph API aborted in IE 11
<p>I am using the following code to upload a large file (but less than 62MB) to OneDrive using Microsoft Graph API.</p>

<pre><code>let req = new XMLHttpRequest();
req.open("PUT", url, true);
req.setRequestHeader("Authorization", "Bearer " + this.authProvider.tokens.graph);
req.setRequestHeader("Content-Length", file.size.toString());
req.setRequestHeader("Content-Range", "bytes 0-" + (file.size - 1).toString() + "/" + file.size.toString() );
req.upload.onprogress = (e) =&gt; {
    let progress = Math.floor(e.loaded / e.total * 100);
    console.log(progress);
};
req.upload.onerror = (e: any) =&gt; {
    console.log("error");
};
req.onload = (e) =&gt; {
    console.log("done");
};
req.send(buffer);
</code></pre>

<p>This is going through fine from Chrome (latest version to date) but after creating the session, the upload is failing on the returned url from the <a href="https://graph.microsoft.io/en-us/docs/api-reference/beta/api/item_createuploadsession" rel="nofollow">create session</a> request. I get the error <code>SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.</code> in IE 11 console and in the network tab I see the request status being <code>aborted</code> and the initiator was a <code>CORS Preflight</code> request. According to other tests I think the error originates from <code>req.open("PUT", url, true);</code> line.</p>

<p>-Update-</p>

<p>Its actually the Pre-flight CORS (OPTIONS) request to the returned URL that is actually failing which gets through in Chrome just fine.</p>