Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fileUpload: function(e,d,o) {
if(this.$.upfile.value == null) return;
this.fileUploading = true;
var formData = new FormData();
formData.append('upfile', this.$.upfile.files[0], this.$.upfile.value );
formData.append('proposal', this.proposal.id);
var xhr = new XMLHttpRequest();
xhr.open('POST', '/jaxson/proposals/file_upload?token=' + BPC.user.token, true);
xhr.onload = function(e) {
if(xhr.status === 200) {
var response = JSON.parse(xhr.responseText);
this._jaxson(response);
}
}.bind(this);
xhr.send(formData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.