• 菜单
  • 标签
  • 主页
  • 所有文章
  • 我的git仓库
  • 我的博客
Array ES5 ES6 MySQL a-table ant-design-vue css form-data javascript nextjs nodejs pdf sass typescript uni-app vue vue-worker vue2 vue3 webpack worker多线程 下载 压缩 小技巧 尺寸自适应 文件类型 树状数组 正则 验证

  • 主页
  • 所有文章
  • 我的git仓库
  • 我的博客
2022-11-17

nodejs 接收form-data数据

  • form-data
  • nodejs
服务器

nodejs 服务器接收form-data数据

1
2
3
4
5
6
7
8
9
10
11
const multiparty = require('multiparty');
const form_data = new multiparty.Form();


router.post('/upload', (req) => {
<!-- fields: Json数据 files: 文件数据 -->
form_data.parse(req, function (err, fields, files) {
console.log(err, fields, files);
});
});

<
worker多线程使用
通过vue-cli创建uni项目
>
蜀ICP备20003029号-1