0

本文档中,没有设置 Blob 服务属性的示例。

以下是我的示例代码:

let containerClient = blobServiceClient.getContainerClient(CONTAINERNAME),
    blockBlobClient = containerClient.getBlockBlobClient(BLOBNAME);

await blockBlobClient.uploadFile(FILEPATH);

请告知我如何上传带有blockBlob设置contentDispositioncontentTypein的文件。properties

4

1 回答 1

3

请尝试这种方式:

    const blobOptions = { blobHTTPHeaders: { blobContentType: 'image/jpeg', blobContentDisposition: "attachment; filename=package.jpg" } };
    const uploadBlobResponse =await blockBlobClient.uploadFile(filePath,blobOptions);

如果还有其他问题,请告诉我!

于 2020-10-22T09:56:30.593 回答