title: Images are not storing in Database using multer
body: <p>I am trying to store image in local folder and save image name in mongodb using <code>multer</code> with the below code.</p>
  
  <pre><code>var uploadDir=__dirname+ '/assets/images';
  var images='.jpg';
  var storage=multer.diskStorage({
    destination:function(req, file, cb){
      cb(null, uploadDir);
    },
    filename:function(req, file, cb){
      console.log(file);
      image=Date.now()+images;
      callback(null, images);
    }
  });
  var upload=multer({storage:storage}).single('img');
  </code></pre>
  
  <p>But its not storing image in local folder and only its saving <code>.jpg</code> string in image field in mongodb. I think the problem is that <code>filename:</code> method is not working. Please review it and help me to find the solution.</p>
  
  <p>Thanks,</p>