I can't figure out how to submit the file I'm importing after clicking OK on the system's file upload window. Here is what I have tried so far:
<input type="file" id="file-input" style="display:none" />
<button class="btn pull-right" ng-click="submitCashierFile()">Import</button>
JavaScript code snippet:
$scope.submitCashierFile = function () {
angular.element('#file-input').trigger('click');
// Need help with submitting the file after selecting it in the modal
$scope.cashierfile.upload = Upload.upload({
url: config.baseAddress + 'test/uploadCashierExcel',
data: { file: $scope.cashierfile }
});
$scope.cashierfile.upload.then(function (response) {
$timeout(function () {
$scope.cashierfile.result = response.data;
toastService.success('You have added .xlsx');
});
}, function (response) {
toastService.error(response);
});
};
After triggering the click and opening the modal to select the file, I need guidance on how to actually submit it upon clicking OK in that modal window. Any suggestions?