* @cfg {String} method GET or POST (default GET), POST will create a form, and post that into the hidden frame.
* @cfg {Boolean} newWindow (optional) download to new window
* @cfg {Function} success (optional) MAY fire on download completed (fails on attachments)..
-
+* @cfg {Number} timeout (optional) in milliseconds before it gives up (default 30000 = 30s)
*/
+
Pman.Download = function(cfg)
{
//--- simple method..
cfg.method = cfg.method || 'GET';
- if (cfg.method == 'GET') {
+ if (cfg.method == 'GET' && !cfg.params) {
(function() {
submit = true;
this.csvFrame.src = cfg.url;
- this.cleanup.defer(30000,this);
+ this.cleanup.defer(cfg.timeout || 30000,this);
}).defer(100, this);
return;
}
+
Roo.log("creating form?");
var b = Roo.get(document.body);
this.form = b.createChild({
tag: 'form',
- method : 'POST',
+ method : cfg.method,
action : cfg.url,
target : this.csvFrame.id,
enctype : 'multipart/form-data'
(function() {
submit = true;
this.form.dom.submit();
- this.cleanup.defer(30000,this);
+ this.cleanup.defer(cfg.timeout || 30000,this);
}).defer(100, this);