我想将2个图像数组从我的前端角度传递到后端节点js
这是我获取前端数据的后端代码
router.post( "",multer({ storage: storage }).array(
'image[]',6,
'freeimagePath[]', 8
) ,
(req, res, next) => {
console.log("image is ",req.body.image);
console.log("freeimage is ",req.body.freeimage);
}```
回答如下:您可以使用表格multipart/form-data
发送此类图像。因此它可以选择多个图像或使用多个输入。
您可以查看这篇文章:Implementing File Upload Using Node and Angular
我想将2个图像数组从我的前端角度传递到后端节点js
这是我获取前端数据的后端代码
router.post( "",multer({ storage: storage }).array(
'image[]',6,
'freeimagePath[]', 8
) ,
(req, res, next) => {
console.log("image is ",req.body.image);
console.log("freeimage is ",req.body.freeimage);
}```
回答如下:您可以使用表格multipart/form-data
发送此类图像。因此它可以选择多个图像或使用多个输入。
您可以查看这篇文章:Implementing File Upload Using Node and Angular