Closed mani95lisa closed 5 years ago
const result = await this.ctx.curl(picUrl, { streaming: true }); const stream = result.res; const bufs = []; let buf = null; const read = new Promise((resolve, reject) => { stream.on('data', chunk => { bufs.push(chunk); }); stream.on('end', () => { buf = Buffer.concat(bufs); console.log('end'); resolve(buf); }); stream.on('error', () => { reject(); }); }); const r = await read; return await api.uploadMedia(r, 'image', 'image/jpg', 'image/jpg');
一直提示 {"errcode":40005,"errmsg":"invalid file type hint: [TPYgvA00951538]"} 就是获取了一个临时的二维码,然后打算推送消息给到用户,不知道这种用法具体错在哪里呢,多谢。
使用文件地址是没任何问题的
一直提示 {"errcode":40005,"errmsg":"invalid file type hint: [TPYgvA00951538]"} 就是获取了一个临时的二维码,然后打算推送消息给到用户,不知道这种用法具体错在哪里呢,多谢。