当我上传.gzip文件时,它在nodejs控制台日志中给我这个错误。 错误:
UnsupportedMediaTypeError: unsupported content encoding "zlib"
我的文件上传目标:
http://192.168.0.105:4000/api/mqtt_collector/uploadFile
API代码:
var upload = multer({
storage: multer.diskStorage({
destination: './Media/Client_Invoice',
filename: function (req, file, cb) {
cb(null, file.originalname);
}
});
});
module.exports.uploadFile = upload.single('NETWORK_FILE'), function (req, res, next) {
console.log('Uploade Successful');
}
我们正在使用mqtt插件开发路由器远程系统。当路由器在这个api上发送文件时。我收到了这个错误。
它在postman中运行良好,但是当路由器发送此文件时,它会出错。