[Fixed] I want to upload multiple images using express and mongodb


SO i have been following this tutorial by geeksforgeeks here is the link: https://www.geeksforgeeks.org/upload-and-retrieve-image-on-mongodb-using-mongoose/ but it shows how to upload one image at once, if i want to upload multiple images what should i do? Pls help


Hello and welcome to Stack Overflow!

In this line:

app.post('/', upload.single('image'), (req, res, next) => {

instead of upload.single you can use

upload.array('image', 12)

Please check multer docs for all the details:


Leave a Reply

(*) Required, Your email will not be published