举例我现在收到一个FileStream {...这样的文件流,现在要保存成文件,于是我使用了fs,假设stream变量就是那个文件流:
const fs = require('fs')
const filepath = fs.createWriteStream('files/x.xlsx')
fs.createReadStream(filepath).pipe(stream)
最终我得到的结果是:
nodejs.TypeError: path must be a string or Buffer
这边发现fs的createReadStream方法是不能直接读取文件流的,但是没有找到其他的方法,请问有没有什么方法可以让Node读取文件流呢?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这是用流的方式把
x.xlsx拷贝成x_copy.xlsx