title: jquery file upload to tornado web server with different domain
body: <p>im trying to use <a href="https://github.com/blueimp/jQuery-File-Upload" rel="nofollow">jquery file upload</a> to post files to a fileserver written in tornado.
  while i can post a file to the same domain i have issues if my fileserver is on a different domain or a subdomain of the origin. lets say from mydomain.com to files.mydomain.com</p>
  
  <p>on the tornado web handler i set up an OPTIONS and a POST handler. the options function looks like this:</p>
  
  <pre><code>def options(self):
      self.set_header('Access-Control-Allow-Origin', '*')
      self.set_header('Access-Control-Allow-Methods', 'POST, OPTIONS')
      self.set_header('Access-Control-Max-Age', 1000)
      self.set_header('Access-Control-Allow-Headers', '*')
      self.set_status(200)
  </code></pre>
  
  <p>in the console i get a</p>
  
  <pre><code>XMLHttpRequest cannot load http://files.mycomain.com/upload. Origin http://mydomain.com is not allowed by Access-Control-Allow-Origin.
  </code></pre>
  
  <p>but the response shows that the Access-Control-Allow-Origin header is set to *.</p>
  
  <p>how can i make this thing work?</p>