I am new to angular. I have searched a lot but didn't find a way to grab the data send through Upload.upload() of ng-file-upload. Though my file is uploaded into the destination folder using muter
Here is my controlled function which is called on upload click from the view.
$scope.doUpload = function() {
Upload.upload({
url: '/api/upload/',
data: {'sabhaDetails': sabhaDetails},
file: sabhaFile,
fileName: sabhaDetails.sabha_video_name
});
}
In my route I have:
/ annotator page. (http://localhost:1337/api/upload)
annotationRouter.route('/upload')
.post(function(req, res) {
**console.log(req.data);**
upload(req, res, function(err) {
if(err) {
res.json({ error_code:1, err_desc:err });
return;
}
res.json({ error_code:0, err_desc:null });
})
});
But I am getting undefined for my req.data. Is there something wrong. How to grab the send data through upload?