1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| $scope.upload = function(){
var form = new FormData(); var file = document.getElementById('eleId'); form.append('file',file);
form.append('name','zhangweixi'); var url = "http://www.xx.com/upload"; $http({ method:"post", url:url, data:form, headers:{"Content-Type",undefined}, transformRequest:angular.identify }).success(function(res){
});
}
|