Multer gives unexpetcted end of form error

Viewed 793

The file is being send to the nodejs server, but the upload.single gives an unexpected end of form error. How do i fix this?

const upload = multer({ dest: "../../uploaded_images" });    
router.patch("/profile", upload.single("profileImage"), (req, res) => {   
    console.log(req.files) // This shows that there is a file named profileImage, I can see that when I remove the upload.single("profileImage")
    res.send("")
})

the file structure:

enter image description here

0 Answers
Related