title: OPTIONS 405 (Method Not Allowed)
body: <p>So I'm attempting to get a progress bar on file uploads on my site. If I simply upload the resource</p>
  
  <pre><code>$.ajax({
      url: $rootScope.URL,  //Server script to process data
      type: 'POST',
      beforeSend: beforeSendHandler,
      success: completeHandler,
      error: errorHandler,
      data: formData,
      cache: false,
      contentType: false,
      processData: false
  });
  </code></pre>
  
  <p>It works perfectly, however if I add the event to listen to progress:</p>
  
  <pre><code>$.ajax({
      url: $rootScope.URL,  //Server script to process data
      type: 'POST',
      xhr: function() {  // Custom XMLHttpRequest
          var myXhr = $.ajaxSettings.xhr();
          if(myXhr.upload){ // Check if upload property exists
              myXhr.upload.addEventListener('progress',progressHandlingFunction, false); // For handling the progress of the upload
          }
          return myXhr;
      },
      beforeSend: beforeSendHandler,
      success: completeHandler,
      error: errorHandler,
      data: formData,
      cache: false,
      contentType: false,
      processData: false
  });
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>OPTIONS myserver.com/controller/filtercontroller.php? 405 (Method Not Allowed)
    jQuery.ajaxTransport.send 
    jQuery.extend.ajax    
    (anonymous function)  
    jQuery.event.dispatch 
    jQuery.event.add.elemData.handle  
  XMLHttpRequest cannot load myserver.com/controller/filtercontroller.php?. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63342' is therefore not allowed access. The response had HTTP status code 405.
  </code></pre>
  
  <p>So obviously my server doesn't have <code>Access-Control-Allow-Origin</code> and <code>OPTIONS</code> right? But the top 2 lines of <code>filtercontroller.php</code> are:</p>
  
  <pre><code>header('Access-Control-Allow-Origin: *');
  header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
  </code></pre>
  
  <p>I've tried several different solutions and none have worked for me.</p>