I am trying to upload a file with angular and asp.net mvc. The file was uploaded in the folder and I am returning an action result from the c# controller. But I am getting the error Cannot read property 'then' of undefined
.
uploadFile = function (file) {
var self = this;
var formData = new FormData();
formData.append('file', file);
$http.post(self.baseUrl + "Admin/uploadFile", formData,
{
withCredentials: true,
headers: { 'Content-Type': undefined },
transformRequest: angular.identity
}).then(function (data, status, headers, config) {
conslole.log(1);
})
}