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
Hello,
first of all thank you for this work which simplifies a lot of things. I just have a little quesiton after playing with a lot of tests.
Do we have other options than playing with this kind of tricks to redefine metada & filename with multer?
https://github.com/ekline-expnet/mongoose-gridfs-multer/blob/master/index.js
thanks for your time
The text was updated successfully, but these errors were encountered:
@PierreBrisorgueil
If you look on mongoose-gridfs multer implementation, file metadata and aliases are derived from the incoming http request.
incoming http request
Options: redefine metada & filename with multer?
metadata
aliases
getFilename
getMetadata
Sorry, something went wrong.
@lykmapipo Ok :) thx for this informations !
to give ideas with alternative example :
const GridFsStorage = require('multer-gridfs-storage'); new GridFsStorage({ db: connection, file: (req, file) => new Promise((resolve, reject) => { crypto.randomBytes(32, (err, buf) => { if (err) return reject(err); const fileInfo = { metadata: { user: req.user._id }, filename: buf.toString('hex') + path.extname(file.originalname), bucketName: 'uploads', }; resolve(fileInfo); }); }),
lykmapipo
No branches or pull requests
Hello,
first of all thank you for this work which simplifies a lot of things. I just have a little quesiton after playing with a lot of tests.
Do we have other options than playing with this kind of tricks to redefine metada & filename with multer?
https://github.com/ekline-expnet/mongoose-gridfs-multer/blob/master/index.js
thanks for your time
The text was updated successfully, but these errors were encountered: