Sails.JS文件上传 - 无法在req.file()上获取文件

蔡一鸣*_*蔡一鸣 5 node.js sails.js

我刚开始使用Sails.JS,我尝试上传一个简单的文件.在Sails.JS中,我做到了这一点:

uploadFile: (req, res) => {
		req.file('avatar').upload({
			dirname: '../../assets/uploads'
		}, function (err, uploadedFiles){
			if (err) return res.serverError(err);
			return res.json({
				message: uploadedFiles.length + ' file(s) uploaded successfully!',
				files: uploadedFiles
			});
		});
	}
Run Code Online (Sandbox Code Playgroud)

对于邮递员,我做到了这一点: 通过邮递员上传文件

问题是,在我通过Postman上传文件后,我没有在req.file()中获取文件.但是,console.log(req)确实显示了我上传的文件的二进制文件(或类似的东西).我只是无法弄清楚发生了什么.