bodyparser已经不和Express绑定在一起了,这个在上传文件时该怎么使用?
高洛峰2017-04-17 15:35:20
const multer = require('multer');
const upload = multer({ dest: path.join(__dirname, '../../uploads/') });
_router.post('/resource', upload.single('file'), (req, res) => {
// req.file
});
前端传过来的时候form key 为file.
http://expressjs.com/en/4x/ap...
https://github.com/expressjs/...