Node.js 当我尝试在没有图像的情况下保存时,会显示以下错误&引用;“讯息”:&引用;无法读取属性';路径';“未定义”的定义&引用;
当我尝试在没有图像的情况下保存时,会显示以下错误“消息”: 无法读取未定义的属性“path” //以下是我的产品路线Node.js 当我尝试在没有图像的情况下保存时,会显示以下错误&引用;“讯息”:&引用;无法读取属性';路径';“未定义”的定义&引用;,node.js,multer,Node.js,Multer,当我尝试在没有图像的情况下保存时,会显示以下错误“消息”: 无法读取未定义的属性“path” //以下是我的产品路线 router.post("/", checkAuth, upload.single('productImage'), ProductsController.products_create_product); 像支票一样兑现 req.file? req.file.path : null 在req.file.path中,部分req.file解析为undefined,这就
router.post("/", checkAuth, upload.single('productImage'),
ProductsController.products_create_product);
像支票一样兑现
req.file? req.file.path : null
在
req.file.path
中,部分req.file
解析为undefined
,这就是为什么您会得到errortry with req.file?req.file.path:空
req.file? req.file.path : null