Search code examples
javascriptamazon-web-servicesamazon-s3jquery-upload-file-plugin

XMLHttpRequest to Amazon S3 fails only on some computers


Our web app is an uploader the pushes directly to Amazon S3. It has never failed testing, however, now that a client has the software they are experiencing a 50/50 success rate per computer.

Seems that the error appears on any browser on the bad computers: XMLHttpRequest cannot load "www.DOMAIN.json". Origin ... is not allowed by Access-Control-Allow-Origin.

  • host file does not have unique settings
  • network that the computer is connected to does affect outcome
  • two similar computers (os, browser, network) and one works, the other doesn't.

This is the jQuery uploader, modified. We use CORS method. https://duckduckgo.com/Cross-origin_resource_sharing?ia=about

Any experienced cross-domain warriors out there?


Solution

  • Good news! We sorted this out by adding https:// to the app URL. This doesn't 100% solve our current problem, but it allows us to program a more graceful fallback.