Skip to content

Aborting an iframe upload in IE8 #214

Closed
@paftek

Description

@paftek

Hi,

The abort method of the XHR mock object has no effect in IE8.
I am using the latest version of the Form plugin: 3.09

The following line is not enough:

$io.attr('src', s.iframeSrc); // abort op in progress

Adding something like that around solves the problem (found on stackoverflow: Is it possible to cancel file upload that uses hidden iframe?):

io.contentWindow.stop(); //for anything but IE
io.contentWindow.document.execCommand("Stop"); // for IE

I ended up with :

try {
    if ( $.isFunction(io.contentWindow.stop) ) {
    io.contentWindow.stop();
    }
    else {
    io.contentWindow.document.execCommand('Stop'); // IE browsers
    }
}
catch (ex) {
    log('cannot abort upload gracefully...' + ex);
}

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions