我上传了一个data.json文件, 然后想要把里面的内容读取出来
已经解决,内容藏得有点深
const stream = await ctx.getFileStream(); // 读取流
使用
stream.on('data',function(chunk) {
// 读取内容
})
我是直接用stream._readableState.buffer.head.data.toString()也能取到值,不过你的比较好
明显你这个不是正规用法,会有坑
需要学习下 stream
Most helpful comment
明显你这个不是正规用法,会有坑