运用request获取微信小程序码二进制流后,想要存储到云开发的文件管理,但一直提示文件路径是read-only file system,有哪位大哥知道咋整吗
return new Promise((resolve, reject) => {
let stream = request({
url: url,
method: "POST",
headers: {
"content-type": "application/json",
"content-Length": JSON.stringify(data).length
},
body: json
})
.pipe(fs.createWriteStream(path.join(__dirname, 'demo.png')))
stream.on('finish', function () {
cloud.uploadFile({
cloudPath: 'demo.png',
fileContent: '/var/user/demo.png',
})
})
微信小程序开发问题解答
微信小程序开发者回答:
您好 请问解决了嘛
本文网址:http://www.91bianli.com/weixinxiaochengxu/47585.html