Javascript – How do I adjust Multer to hold off on saving an image until after successfully completing the database entry using Mongoose?
The usual Multer setup saves files right away, as shown in the basic example below: const multer = require('multer'); const upload = multer({ dest: 'uploads/' }); const app = express(); app.post('/profile', upload.single('avatar'), function (req, res, next) { // req.file is…