Script5: Access denied in IE9 when website is opened from gmail email link #457
Comments
Thanks for the report. I currently don't have the resources to tackle this issue but I'm open for a user contributed fix. |
I can confirm this happens. A request to the server is actually made though, but it returns a url 1 character at a time for the json response... I'm having an error of uploads not starting in IE9 with my sites implementation of the file uploader. Works fine on the demo site, and used to work on my site until we began to customize the html and extend methods etc... Not sure what we've done that causes the uploader to break, but possibly could be related if we can figure it out. Although it may not be since our issue is that IE9 won't even fire a request to the server once a file is selected (autoUpload is true). |
All I've been able to come up with is that for some reason in IE9 the following data.submit() doesn't do anything even though I've confirmed that the code is being triggered and data is set to being validated. https://github.com/blueimp/jQuery-File-Upload/blob/master/jquery.fileupload-ui.js#L74 I've also tried modifying it to be data.form.submit() or data.form[0].submit() and that change will get fired by IE, but none of the form data is sent... Edit: Actually it looks like the problem is that the form being serialized for the iframe transport is just returning an empty array, but wouldn't that still at least fire off a request to the server? |
I was able to resolve my issue of IE9 not firing the requests by ensuring that the file input was within ancestor elements containing the .fileupload-buttonbar & .fileinput-button classes. We were trying to implement our own buttons, and despite overwriting just about every method we could see referencing those classes for anything meaningful IE9 simply would not properly build the iframe / form without those classes. |
I've revisited this issue and could finally track it down to a browser bug: IE9 (and possibly other IE versions) doesn't allow submitting a HTML form programmatically (neither via form.submit() nor via button.click()), if the containing document has been opened via a Gmail link. Instead the browser will throw the following error in the developer console, indicating the line containing form.submit() or button.click():
I've created a JSFiddle in pure JavaScript, without including the jQuery File Upload plugin or even jQuery, to demonstrate the problem: To reproduce it, the following link to the JSFiddle result frame has to be followed via an email received via Gmail: The demo code is very simple and included below: <form method="POST" enctype="multipart/form-data" id="form">
<input type="file" name="files[]" id="input">
</form>
<script>
var input = document.getElementById('input'),
form = document.getElementById('form'),
submit = function () {
form.submit();
};
if (input.addEventListener) {
input.addEventListener('change', submit, false);
} else if (input.attachEvent) {
input.attachEvent('change', submit);
}
</script> As to why this only happens with links opened via Gmail, I couldn't find out yet. |
Why is this issue closed? I just followed to demo page from gmail in IE9 and script access denied error is still there. Plugin does not work with IE9 on links from gmail. |
This issue has never been closed. You probably misinterpreted the closed badges of the referenced issues. Anyway, this issue is unrelated to the plugin itself since it can be reproduced with the simple code snippet I posted in my comment above. It's definitely a browser bug (or maybe a browser security feature) in IE9. |
I see. Thanks |
Not that this is much help, but I opened an MSDN case for this. They verified the problem exists in IE9 and doesn't exist in any other version (including 10). They provided a workaround (use IE8 compatibility on the Gmail page), but told me that because they provided a workaround, they wouldn't dig to find a root cause or a true fix unless I paid for "Premier Support". |
Thanks @Jaswolf. |
@blueimp: And the bug it also affects that browser window in other ways:
Note: |
To reproduce the problem:
I have reproduced the issue on IE9 (but in IE8 and IE7 mode). If you open a new windows and go to the demo site, uploading works. It really breaks when the demo page is opened by clicking on the linking within gmail.
Thanks for the help - and thanx for this great tool!
The text was updated successfully, but these errors were encountered: