ExpressJS Multer: Upload image to server
问题 I'm newer with Node.js and Express.js. I want to upload first a image into the server (directory: uploads/spots), and then (synchronous) upload the rest of form data in MongoDB. I'm using REST (Method Post) app.route('/spots').post(users.requiresLogin, spots.create); and I'm using Multer for updating the image into the server, and works. app.use(multer( { dest: './public/uploads/spots', onFileUploadStart: function (file) { var imagePath = file.path; gm(imagePath).resize(850, 850).quality(70)