1,express集成了formidable库
使用app.use(express.bodyParser({uploadDir:TEST_TMP,keepExtensions:true});
来更改上传目录,并保留原文件的后缀名
2,读取上传的该文件信息代码如下:
exports.upload = function(req,res,next){
var filename = req.files.upload.path; //文件存放绝对路径
var title = req.files.upload.name; //上传后解析过的文件名
console.log(req); //通过看req的内容就知道了
};