나는 angularJs를 사용하여 서버에 http Post
요청을합니다. NodeJs 서버에 파일을 업로드 할 수는 있지만 요청에서 keywords
을 가져 오는 방법을 알 수 없습니다.nodejs에서 양식 데이터 매개 변수를 가져 오는 중
클라이언트 코드 (AngularJS와)
var file = $scope.myFile;
var uploadUrl = HOST_URL+"/filter-reports";
var fd = new FormData();
fd.append('file', file);
fd.append('keywords','searchkey1, searchkey2');
$http.post(uploadUrl, fd, {
transformRequest: angular.identity,
headers: {'Content-Type': undefined}
})
.success(function(data){
console.log('Fetched the data .. '+data);
})
.error(function(){
console.log('could not fetch the data .. ');
});
나 Node.js를에 FormData
매개 변수를 추출하기 위해 알려 나는 NodeJs 새로운 오전으로 내가 잘못 가고 어딘지 알려 주시기 바랍니다.