Jump to content

Gostaria de saber como guardar URL de múltiplas imagens, com node js

Recommended Posts

Quando realizo upload de uma única imagem com multer, utilizo o req.file para guardar URL no banco:

app.post ( '/post' ,  upload .single ( 'img') ,  function  ( req ,  res ,  next )  {

    console.log(req.body, req.files)


         const image = req.files.filename


        const imgURL = image;



            titulo: req.body.titulo,

             descricao: req.body.descricao,

             imgURL: imgURL

         }).then(() => {



  } )

Gostaria de saber como faço para guardar URL no banco, quando fizer upload de varias imagens, pelo metodo, upload . array.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...