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
const storage = new GridFsStorage({ url: URL, cache: true, file: (req: any, files: any) => { return new Promise((resolve, reject) => { // is not running in here try { crypto.randomBytes(16, (err: any, buf: { toString: (arg0: string) => any }) => { if (err) { return reject(err); } const id = primaryKey(); const filename = buf.toString('hex') + path.extname(files.originalname); const fileInfo = { filename: filename, bucketName: 'uploads', metadata: { id_file: id, // Trường để lưu _id của tệp tin }, }; resolve(fileInfo); }); } catch (error) { console.log(error); } }); }, }); console.log(storage, 'storage'); export const upload = multer({ storage: storage }); router.post('/sendChat', upload.array('files'), sendChatController.sendChat);
The text was updated successfully, but these errors were encountered:
Does bun have a crypto.randomBytes module and API?
bun
crypto.randomBytes
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: