【问题标题】:Azure blob storage using a WriteStream to upload dataAzure Blob 存储使用 WriteStream 上传数据
【发布时间】:2020-08-14 08:49:43
【问题描述】:

我需要使用写入流将数据上传到 nodejs 中使用 @azure/storage-blob 的 azure blob-storage 容器。

看起来uploadStream 只接受nodejs ReadStreams。

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

【问题讨论】:

标签: node.js azure-blob-storage node-streams


【解决方案1】:

使用 PassThrough 有效!

const stream = new PassThrough()
this.containerClient.getBlockBlobClient(filePath).uploadStream(stream)
return stream

【讨论】:

    猜你喜欢
    • 2019-04-06
    • 2014-08-23
    • 2020-04-03
    • 2020-03-12
    • 2016-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多