Skip to content
This repository was archived by the owner on Feb 9, 2019. It is now read-only.

Commit 72e12da

Browse files
committed
Merge pull request #8 from travist/master
Would like to allow derived classes the ability to provide their own form.
2 parents 6d1cd72 + 4ff287e commit 72e12da

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/ux/Fileup.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,17 +466,28 @@ Ext.define('Ext.ux.Fileup', {
466466
};
467467
}
468468

469-
// Create FormData object
470-
var form = new FormData();
471-
472-
// Add selected file to form
473-
form.append(me.getName(), file);
474-
475469
// Send form with file using XMLHttpRequest POST request
476470
http.open('POST', me.getUrl());
477-
http.send(form);
471+
http.send(me.getForm(file));
478472
},
479473

474+
/**
475+
* @method getForm
476+
* Returns the form to send to the browser.
477+
*
478+
* @param {Object} file Link to loaded file element
479+
*/
480+
getForm: function(file) {
481+
// Create FormData object
482+
var form = new FormData();
483+
484+
// Add selected file to form
485+
form.append(this.getName(), file);
486+
487+
// Return the form.
488+
return form;
489+
},
490+
480491
/**
481492
* @method reset
482493
* Component reset

0 commit comments

Comments
 (0)