title: Is Content-Disposition attachment blocked from XMLHttpRequest?
body: <p>I want to perform a javascript xhr request for a png file from a C# webserver which I wrote.
  Here is the code I use</p>
  
  <pre><code>    var imgUrl = "http://localhost:8085/AnImage.png?" + now;
      var request = new XMLHttpRequest();
      request.open('GET', imgUrl, false);
      request.send(); // this is in a try/catch
  </code></pre>
  
  <p>On the server-side I send back the file and add a Content-Disposition header.
  I obtain the following response</p>
  
  <p><img src="https://i.stack.imgur.com/R5ry1.png" alt="The headers obtained in the response, with Firebug"></p>
  
  <p>I made sure that Content-Disposition was attached in the headers after the Content-Type (the screenshot is from Firebug, which appends in alphabetical order).</p>
  
  <p>The results is that no dialog box is triggered, am I missing something in the response?</p>
  
  <p>edit:
  I want to perform everything in javascript for several reasons. 
  First: I don't want to show the image and I want to keep everything behind the curtain. 
  Second: when requesting the image I want the Content-Disposition to be added only on particular requests. Such requests are marked with a "Warning" header with value "AttachmentRequest"</p>
  
  <pre><code>request.setRequestHeader("Warning","AttachmentRequest");
  </code></pre>