i am using the FileUploader module to upload my file from angular to my REST API:
var uploader = $scope.uploader = new FileUploader({
url: api.getUrl('uploadCompetence',null)
});
This is sent to the following POST function:
router.route('/api/uploadCompetence')
.post(function (req, res) {
// This is where i want to read the file
var competence = Competence.build(req.body.location);
competence.add(function (success) {
res.json({message: 'quote created!'});
},
function (err) {
res.status(err).send(err);
});
})
My current objective is to read the excel file and add each row to my database thereafter.
I'm not exactly sure how I can read the file from Node, though.
Js, I've looked everywhere when debugging my server, but my Angular application is calling the API instead.