Created
April 28, 2015 12:35
-
-
Save jmas/30a3f42b538414566905 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.post('/upload', | |
[ multer({ | |
dest: path.join(__dirname, '..', config.imagesUplodsPath), | |
rename: function (fieldname, filename) { | |
return filename.replace(/\W+/g, '-').toLowerCase() + Date.now() | |
} | |
}) ], | |
function(req, res, next) { | |
res.json({ | |
success: true, | |
result: { | |
url: '/image/' + req.files.file.name | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment