summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorctrlaltca <>2012-05-25 10:33:43 +0000
committerctrlaltca <>2012-05-25 10:33:43 +0000
commitac8908ea795f22e4bcf8726971919d6413a0b9e6 (patch)
treefea6cdd914ab974b59831cd5441b87bbb3e48ec5
parent79032e37b82acfec6df9e4e7f7986ecc77ae7c6f (diff)
TActiveFileUpload: enforce method and enctype to avoid some browsers being picky on controls created on ajax response
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/activefileupload.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
index b16179c0..5f20944e 100755
--- a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
+++ b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
@@ -29,11 +29,19 @@ Prado.WebUI.TActiveFileUpload = Class.create(Prado.WebUI.Control,
// set the form to submit in the iframe, submit it, and then reset it.
this.oldtargetID = this.form.target;
this.oldFormAction = this.form.action;
+ this.oldFormMethod = this.form.method;
+ this.oldFormEnctype = this.form.enctype;
+
this.form.action += (this.form.action.indexOf('?')!=-1 ? '&' : '?')+'TActiveFileUpload_InputId='+this.options.inputID+'&TActiveFileUpload_TargetId='+this.options.targetID;
this.form.target = this.options.targetID;
+ this.form.method = 'POST';
+ this.form.enctype = 'multipart/form-data';
this.form.submit();
+
this.form.action = this.oldFormAction;
this.form.target = this.oldtargetID;
+ this.form.method = this.oldFormMethod;
+ this.form.enctype = this.oldFormEnctype;
},
finishUpload : function(options){