title: File uploading in express using multer
body: <p>I am trying to upload image using multer but getting error,uploads is not a function.Here is my code</p>
  
  <pre><code>var multer = require('multer');
  var uploads = multer({dest: './images'});
  app.post('/uploading', uploads.single('image'), function(req, res) {
    console.log(req.file);
  var file = __dirname + '/' + req.file.filename;
    uploads(req.file.path, file, function(err) {
      if (err) {
        console.log(err);
        res.send(500);
      } else {
        res.json({
          message: 'File uploaded successfully',
          filename: req.file.filename
        });
      }
    });
  </code></pre>