X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-core-debug.js;h=a61b053ac6e6c9e2a513b58d6664a8601ecbe13f;hb=d59b277dae414c8ed4dbc3522847f5f1b495081a;hp=03cebb1b2b5d497c9a514fcd6bbf77a32dc000d4;hpb=d3774fe5e402568711ecdf98159de501cd062c33;p=roojs1 diff --git a/roojs-core-debug.js b/roojs-core-debug.js index 03cebb1b2b..a61b053ac6 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -11612,6 +11612,11 @@ Roo.extend(Roo.data.Connection, Roo.util.Observable, { url = url || form.action; var enctype = form.getAttribute("enctype"); + + if (o.formData) { + return this.doFormDataUpload(o,p,url); + } + if(o.isUpload || (enctype && enctype.toLowerCase() == 'multipart/form-data')){ return this.doFormUpload(o, p, url); } @@ -11789,7 +11794,40 @@ Roo.extend(Roo.data.Connection, Roo.util.Observable, { form.removeChild(hiddens[i]); } } + }, + // this is a 'formdata version???' + + + doFormDataUpload : function(o, ps, url) + { + var form = Roo.getDom(o.form); + form.enctype = form.encoding = 'multipart/form-data'; + var formData = o.formData === true ? new FormData(form) : o.formData; + + var cb = { + success: this.handleResponse, + failure: this.handleFailure, + scope: this, + argument: {options: o}, + timeout : o.timeout || this.timeout + }; + + if(typeof o.autoAbort == 'boolean'){ // options gets top priority + if(o.autoAbort){ + this.abort(); + } + }else if(this.autoAbort !== false){ + this.abort(); + } + + //Roo.lib.Ajax.defaultPostHeader = null; + Roo.lib.Ajax.useDefaultHeader = false; + this.transId = Roo.lib.Ajax.request( "POST", url, cb, o.formData, o); + Roo.lib.Ajax.useDefaultHeader = true; + + } + }); /* * Based on: @@ -16573,6 +16611,7 @@ Roo.apply(Roo.XComponent, { msg: msg, width:450, progress:true, + buttons : false, closable:false, modal: false