1、安装multer模块
npm install multer
2、引入依赖
const multer = require('multer');
var objMulter=multer({dest: './upload'});//设置上传文件路径
server.use(objMulter.any());//设置中间件
tip:表单中<input type='file' name='f1'> name属性是必须的!
1、安装multer模块
npm install multer
2、引入依赖
const multer = require('multer');
var objMulter=multer({dest: './upload'});//设置上传文件路径
server.use(objMulter.any());//设置中间件
tip:表单中<input type='file' name='f1'> name属性是必须的!