filesDidChange: function(files) { const uploader = EmberUploader.Uploader.create({ url: this.get('url') }); if (!Ember.isEmpty(files)) { // this second argument is optional and can to be sent as extra data with the upload //uploader.upload(files[0], { whatheverObject }); } }
filesDidChange: function(files) { const uploader = EmberUploader.Uploader.create({ url: window.API_HOST + '/upload' }); var self = this; if (!Ember.isEmpty(files)) { // this second argument is optional and can to be sent as extra data with the upload uploader.upload(files[0]).then(data => { self.sendAction('uploaded', data); }); } }
filesDidChange: function(files) { const uploader = EmberUploader.Uploader.create({ url: window.API_HOST + '/cloudwares/upload' }); var self = this; if (!Ember.isEmpty(files)) { uploader.on('progress', e => { console.log(e); self.sendAction('progress', e.percent); }); // this second argument is optional and can to be sent as extra data with the upload uploader.upload(files[0]).then(data => { self.sendAction('uploaded', data); }); } }