I am just starting out with Sailsjs and I tried to make a simple file upload. In the sails I like
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 codeAnd at the postman I liked it

The fact is that after downloading the file through the postman, I do not receive the file in the req.file () file. But while I was console.log (req), I really saw the binary file (something like this). I just can't understand what happened.
source
share