We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to edit dynamic upload path or callback when upload done? Thank
The text was updated successfully, but these errors were encountered:
First of all I apologies I did not know you open the issue here I think it can you can implement like so
const multer = require('multer') const storage = multer.diskStorage({ destination: (req, file, cb) => { const { userId } = req.body const dir = ./uploads/${userId} fs.exists(dir, exist => { if (!exist) { return fs.mkdir(dir, error => cb(error, dir)) } return cb(null, dir) }) }, filename: (req, file, cb) => { const { userId } = req.body cb(null, UserId-${userId}-Image-${Date.now()}.png) } }) const upload = multer({ storage })
expressjs/multer#556 please check this issue for more info
Sorry, something went wrong.
No branches or pull requests
How to edit dynamic upload path or callback when upload done?
Thank
The text was updated successfully, but these errors were encountered: