【问题标题】:Multer gives unexpetcted end of form errorMulter 给出了意外的表单错误结尾
【发布时间】: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("")
})

文件结构:

【问题讨论】:

标签: node.js image file-upload nodejs-server


【解决方案1】:

这似乎是 Multer 本身的一个错误。我通过将 Multer 降级到 1.4.3 来解决。

https://github.com/expressjs/multer/issues/1144

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-14
    • 1970-01-01
    • 2014-12-26
    • 1970-01-01
    • 2018-04-13
    • 2017-05-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多