📅  最后修改于: 2022-03-11 15:02:29.260000             🧑  作者: Mango
var express = require('express');
var multiparty = require('connect-multiparty'),
multipartyMiddleware = multiparty({ uploadDir: './imagesPath' });
var router = express.Router();
router.post('/', multipartyMiddleware, function(req, res) {
console.log(req.body, req.files);
var file = req.files.file;
console.log(file.name);
console.log(file.type);
res.status(200).send('OK');
});
module.exports = router;