i need upload file from
<input class="fromFileInput" id="VeryfyFromFileInput" type="file" fileread="fileContent" ng-click=uploadFile />
using angular
controller:
$scope.fileInformation = [];
$scope.uploadFile = function () {
$scope.fileModel = $('#VeryfyFromFileInput');
recordsService.passFile($scope.fileModel.context);
};
service:
this.passFile = function (data) {
return $http({
method: 'POST',
url: url + "/GetFile",
data: data,
headers: { 'Content-Type': 'application/json' }
});
};
To ASP.NET MVC controller
[HttpPost]
public void GetFile([FromBody] HttpRequestMessage file)
{
}
But i have always null, so which type of parameters i must use instead of 'HttpRequestMessage '? Or maybe problem in JS side?
datacontains anything?