Skip to content

Instantly share code, notes, and snippets.

@pzuraq
Created April 17, 2013 05:10
Show Gist options
  • Save pzuraq/5401940 to your computer and use it in GitHub Desktop.
Save pzuraq/5401940 to your computer and use it in GitHub Desktop.
uploadFile: function(file) {
var self = this,
vehicle = this.get('controller.content'),
photo = Case.VehiclePhoto.createRecord();
console.log(file.data);
photo.set('name', file.name);
photo.set('imageData', file.data);
photo.set('vehicleId', this.get('controller.content.id'));
photo.one('didCreate', this, function() {
self.get('controller.content.photoQueue').removeObject(file);
});
photo.get('transaction').commit();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment