I'm using Ext.Ajax.request to submit a file upload form to work with the Scribd API to upload a document.

The upload works fine, but the response object is returning empty:

         argument: undefined,
         responseText: "",
         responseXML: undefined
Using both Firebug and Safari's developer console, I think the problem is that for some reason the "document" in the iframe used to submit the form is undefined.

When I remove the "x-hidden" class from the iframe, Scribd's return XML is there:

    <rsp stat="ok">
and it's encoded:

    <?xml version="1.0" encoding="UTF-8"?>
I can't figure out why Ext.Ajax.request can't read the XML in the callback function.

It's this function in Ext.data.Connection.doFormUpload that's causing the problem:

    function cb(){
            var r = {  // bogus response object
                responseText : '',
                responseXML : null

            r.argument = o ? o.argument : null;

            try { //
                var doc;
                    doc = frame.contentWindow.document;
                }else {
                    doc = (frame.contentDocument || window.frames[id].document);
                if(doc && doc.body){
                    r.responseText = doc.body.innerHTML;
                if(doc && doc.XMLDocument){
                    r.responseXML = doc.XMLDocument;
                }else {
                    r.responseXML = doc;
            catch(e) {
                // ignore

            Ext.EventManager.removeListener(frame, 'load', cb, this);

            this.fireEvent("requestcomplete", this, r, o);

            Ext.callback(o.success, o.scope, [r, o]);
            Ext.callback(o.callback, o.scope, [o, true, r]);

            setTimeout(function(){Ext.removeNode(frame);}, 100);