连接多方中间获取文件请求未定义

我试图通过connect-multiparty将图像file upload到服务器

 router.post('/image', multipartMiddleware , function(req, res) { console.log(req.body, req.file); }); <form method="post" action="/products/image"> <input type="file" name="file"> <input type="submit" value="Upload"> </form> 

但上面的控制台的结果是{ file: '156.jpg' } undefined ,即我可以得到的文件名,但为什么文件对象不来?

文件内容位于代码中的req.files而不是req.file中。

并且还可以find文件path和文件名

  var tmppath = req.files.file.path; var tmpname = req.files.file.name; 

这里是一个链接 ,我用Node.js上传文件。