Hello my problem is that I use multer to store them on my server and their path on mongodb, but I can't get them to display on my react application.
thanks in advance for all the help.
You need to send the data from React in FormData, example:
Node
import multer from "multer" // const multer = require("multer")
const upload = multer()
// in your route
app.post("/any-route", upload.array("name_id", 10), () => {
let file = null
if (req.files && req.files.lenght > 0){
file = req.file[0]
}
// and this file you can send to MongoDB
})
In react you need use FormData
const FormData = new FormData()
FormData.append("name_id", file) // this file is the file you want send