I am using angularJs to make a http Post request to the server. I am able to get the file uploaded on the NodeJs server, but not able to figure out how to fetch the keywords from the request.
Client Code (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 .. ');
});
Please let me know to to extract FormData parameters on Node.js and let me know where am I going wrong as I am new to NodeJs.