angular/app/components/campaign-add/campaign-add.component.js
// upload on file select or drop
upload on file select or drop
upload on file select or drop
upload (file) {
        this.Upload.upload({
            url: '/api/campaigns/campaigns',
            data: {
                title: this.campaign.title,
                descript: this.campaign.descript,
                msg: this.campaign.msg,
                campaigntype_id: this.campaign.type.id,
                receiversfile: file
            }
        }).then(function () {
        }, function () {
        }, function () {
        });
    }
upload ( file ) { this . Upload . upload ( { url : '/api/campaigns/campaigns' , data : { title : this . campaign . title , descript : this . campaign . descript , msg : this . campaign . msg , campaigntype_id : this . campaign . type . id , receiversfile : file } } ) . then ( function ( ) { } , function ( ) { } , function ( ) { } ) ; }
upload on file select or drop
upload on file select or drop
//console.log('Success ' + resp.config.data.file.name + 'uploaded. Response: ' + resp.data); //console.log('Error status: ' + resp.status); /*var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);*/ //console.log('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);