This is a migrated thread and some comments may be shown as answers.

IE9 problem when running inside an iFrame (Facebook)

2 Answers 112 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Olle
Top achievements
Rank 1
Olle asked on 07 May 2012, 12:53 PM
We're running an webapp inside Facebook (ASP.NET MVC3). In this app we're using KendoUI upload control and all works nice in the browsers except for IE9 that says: 

Access is denied.
kendo.upload.js?t=634716582040000000, line 1032 character 17


Line 1032 is the line form[0].submit(); (line 6 beginning from the end) below.

if (!upload.trigger(UPLOAD, e)) {
    upload._hideUploadButton();
 
    iframe.appendTo(document.body);
 
    var form = iframe.data("form")
        .appendTo(document.body);
 
    e.data = $.extend({ }, e.data, getAntiForgeryTokens());
    for (var key in e.data) {
        var dataInput = form.find("input[name='" + key + "']");
        if (dataInput.length == 0) {
            dataInput = $("<input>", { type: "hidden", name: key })
                .appendTo(form);
        }
        dataInput.val(e.data[key]);
    }
 
    upload._fileAction(fileEntry, CANCEL);
    upload._fileState(fileEntry, "uploading");
 
    iframe
        .one("load", $.proxy(this.onIframeLoad, this));
 
    form[0].submit();
} else {
    upload._removeFileEntry(iframe.data("file"));
    this.cleanupFrame(iframe);
    this.unregisterFrame(iframe);
}

2 Answers, 1 is accepted

Sort by
0
Matt
Top achievements
Rank 1
answered on 20 Sep 2012, 01:48 AM
exact same problem
0
Stéphane
Top achievements
Rank 1
answered on 22 Oct 2012, 06:48 PM
Hi,

I juste solved a similar issue with IE5: Access Denied with async file upload using the Kendu UI Upload.

As recommended by our security guys we added the following header: x-frame-options: DENY

The intent was to prevent other sites to include ours inside an IFrame. But it also prevented the file uploads using an IFrame like Kendo from working...

We were able to fix it by changing the value like this: x-frame-options: SAMEORIGIN

You might want to check your headers just to be shure...
Tags
Upload
Asked by
Olle
Top achievements
Rank 1
Answers by
Matt
Top achievements
Rank 1
Stéphane
Top achievements
Rank 1
Share this question
or