var multer = require('multer'),
storage = multer.diskStorage({
destination: function(req, file, callback) {
callback(null, __dirname + '/public/tmp/upload_avatars');
},
filename: function(req, file, callback) {
var filename = file.fieldname + '-' + Date.now() + '-' + file.originalname;
cb(null, filename);
}
}),
upload = multer({ storage: storage });
req.files[0].filename