📜  使用带有节点 js express 的多方 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:29.260000             🧑  作者: Mango

代码示例1
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;