运行环境:centos 6.5
express.js版本:4.11.0
页面相关关键代码
后台相关代码
app.use(require('connect-multiparty')()); //需先npm install connect-multiparty
app.post('/uploadFile', function(req, res, next) {
console.log(req.path);
console.log(req.files.uploadFileName.size);
res.send('upload success');
});
默认上传到当前目录,修改存储路径、改名等可用fs模块实现
阅读(1150) | 评论(0) | 转发(0) |