最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

我想将2个图像数组从我的前端角度传递到后端节点js

IT培训 admin 5浏览 0评论

我想将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

发布评论

评论列表 (0)

  1. 暂无评论