1
votes

I have a form which is posting a file upload to an iFrame:

<form id="upload-form" method="post" action="http://xxxxxxx.com/artist/tracks/upload_complete" enctype="multipart/form-data" target="upload-frame">
...............
    <input name="submit" value="Upload" type="submit">
</form>
<iframe id="upload-frame" name="upload-frame"></iframe>

It is working fine on every browser in windows 7, and osx, however the client has informed me that it's not working for him on chrome on windows 8. I remote desktopped in to look at the error console and it reads

Uncaught SecurityError: Blocked a frame with origin "http://xxxxxxx.com" from accessing a frame with origin "null". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "data". Protocols must match.

Looks like an issue with the same origin policy however both the form and the iframe reside on the same domain.

Is there something I'm missing here?

1
Is anything parentframe or child frame on localhost ?T8y
@bludnerboy not sure if I follow your question. Either way, the project is not on localhost. CheersFraser

1 Answers

2
votes

Here it is, you have an iframe with no src defined that is why you are getting null origin error.

<iframe id="upload-frame" name="upload-frame"></iframe>

Try to set value of src as

  • javascript:false (Works in all browsers except IE10)
  • # (I guess works in all browsers)

Example Usage:

<iframe id="upload-frame" name="upload-frame" src="javascript:false"></iframe>