Express.js application bug: Cannot read property 'transfer-encoding' of undefined

后端 未结 1 877
慢半拍i
慢半拍i 2021-01-27 17:21

I am working on a blogging application (click the link to see the GitHub repo) with Express, EJS and MongoDB.

I am trying to introduce

相关标签:
1条回答
  • 2021-01-27 18:08

    You are missing req and res inside your upload(), try adding those two like upload(req,res, function (err){

    upload(req, res, function (err) {
            if (err) {
                console.log("There was an error uploading the image.");
            }
            res.json({
                success: true,
                message: 'Image uploaded!'
            });
        })
    
    0 讨论(0)
提交回复
热议问题