0
我想通过angularjs(客户端)和Nodejs express(服务器端)上传图片。我不愿意使用表格,因为我的公司没有使用它。Angularjs和Nodejs快递
这是
$scope.uploadPhotoToServer = function() {
console.log('will upload to album ' + this.albumName + ' file ' + this.userPhoto);
var fd = new FormData();
//Take the first selected file
fd.append("file", this.userPhoto);
fd.append("album", this.albumName);
$http.post('/upload', fd, {
withCredentials: true,
headers: {'Content-Type': undefined },
transformRequest: angular.identity
});
}]);
我想,如果你能向我解释如何工作的,我怎么可能继续提前:)