【发布时间】:2023-01-16 22:21:32
【问题描述】:
该文件正在发送到 nodejs 服务器,但 upload.single 给出了意外的表单结束错误。我该如何解决?
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("")
})
文件结构:
【问题讨论】:
-
你得到解决方案了吗?
-
这是我使用的解决方案,它对我有用; Solution to "unexpetcted end of form" error
标签: node.js image file-upload nodejs-server