我正在尝试使用angular和asp.net mvc上传文件。该文件已上传到该文件夹中,我将从c#controller返回一个操作结果。但我收到错误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);
})
}