I am sending a fromfields
as formdata()
var data1 = new FormData();
data1.append('input_file_name', $('#fileName').prop('files')[0]);
data1.append('input_image_name', $('#imageName').prop('files')[0]);
if($scope.fileName!="" && $scope.imageName!="")
{
$http({
url: '/upload',
method: "POST",
data: data1
})
.then(function(response) {
console.log("success")
},
function(response) { // optional
console.log("failed")
});
}
on the server side how to read this formdata
values sent form HttpRequest
.
app.post('/upload',function(req,res)
{
console.log(req.files.file.path)
})
How to read the path of files.