on component ts public uploadFile = (files) => { this._dataService.CompareExcel(this.selectedoptions.toString(),this.fileToUpload) .subscribe(resp => { if (resp) { console.log('Excel is Identical'); if(this.selectedoptions==1) { this._dataService.PostUpload(this.selectedoptions.toString(),this.fileToUpload) .subscribe((response: Blob) => saveAs(response, this.fileToUpload.name + '.xlsx')); } if(this.selectedoptions==2) { this._dataService.PostUploadzip(this.selectedoptions.toString(),this.fileToUpload) .subscribe((response: Blob) => saveAs(response, this.fileToUpload.name + '.zip')); } } else { console.log('Excel Not Identical'); } }); on component.html <button (click)="uploadFile(files)" class="btn btn-link" style="margin-right: 0px"> <nb-icon icon="cloud-upload-outline"></nb-icon> </button>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)