Wednesday, 7 June 2017

upload a file and obtain its file name and save it to database that is in pgsql

in index.js file i have given

router.post('/postfileupload',User.postFileUpload,function(req,res,next){
    User.postFileUpload(req,res);
});

and in user.js I have provided the function definition as:

function postFileUpload(req,res){
  if(req.files)
    console.log('request for fileupload \n ',req.files);
}

and while running the code i get the error "Error: Route.post() requires callback functions but got a [object Undefined]"

Please help...



via Nithin P.H

No comments:

Post a Comment