使用WriteStream上传数据的Azure Blob存储

问题描述 投票:0回答:1

我需要使用写入流使用@azure/storage-blob将数据上传到Node.js中的Azure Blob存储容器。

似乎uploadStream仅接受nodejs ReadStreams。

如何将WriteStream转换为ReadStream,以便可以将其传递给uploadStream函数。

node.js azure-storage-blobs azure-blob-storage node-streams
1个回答
0
投票

使用PassThrough工作!

const stream = new PassThrough()
this.containerClient.getBlockBlobClient(filePath).uploadStream(stream)
return stream
© www.soinside.com 2019 - 2024. All rights reserved.