on client-side: Uploading excel file.
<div> <form> <div> <label for="myFileField">Select a file: </label> <input type="file" demo-file-model="myFile" class="form-control" id="myFileField" /> </div> <button ng-click="uploadFile()" class="btn btn-primary">Upload File</button> </form> </div>
angular controller:
$scope.uploadFile =function(){var file =$scope.myFile;Service.fileUploadAll(file,function(response){}); fileUploadAll(file){var fileFormData =newFormData(); fileFormData.append('file', file);returnthis.promiser.post('/api/fileUpload', fileFormData);
}
[HttpPost("fileUpload")]publicIActionResult fileUploadAll(IFormFile file){
// Do some
}
I'm working on Asp.NET Core . Please help me to resolve this issue.