1

I can't seem to find a good answer to this and I have tried everything. I am using the JQuery.iframe-transport plugin to do a file upload. The problem is that I am uploading to an API on our QA server, qa.company.com, from my local server, localhost:8080. It appears that the upload is fine but then the plugin errors out when it is trying to read the contents of the iframe it created.

Error: Permission denied to access property 'document'

var doc = this.contentWindow ? this.contentWindow.document :
            (this.contentDocument ? this.contentDocument : this.document),

It looks like a permissions error trying to read the iframe document variable since it is from a different domain. Any ideas on how I can work around this?

Tony Smith
  • 869
  • 1
  • 11
  • 25

1 Answers1

0

While you can't use the iframe hack crossdomain and read the content of the frame, i think you can bind the onLoad callback to atleast know something happened.....

The more modern techy solution to this issue is to send CORS heads from you qa server, which would allow you to push to another domain without using an iframe at all.

https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS

j_mcnally
  • 6,928
  • 2
  • 31
  • 46