[英]NodeJS '@azure/storage-blob': How do set Blob Service Properties when uploading a file
From this document , there is no example to set Blob Service Properties.本文档中没有设置 Blob 服务属性的示例。
Below is my Sample Code:下面是我的示例代码:
let containerClient = blobServiceClient.getContainerClient(CONTAINERNAME),
blockBlobClient = containerClient.getBlockBlobClient(BLOBNAME);
await blockBlobClient.uploadFile(FILEPATH);
Please advise how I can upload a file with setting contentDisposition
and contentType
in properties
of blockBlob.请告知我如何通过在 blockBlob 的
properties
中设置contentDisposition
和contentType
来上传文件。
Please try this way:请尝试这种方式:
const blobOptions = { blobHTTPHeaders: { blobContentType: 'image/jpeg', blobContentDisposition: "attachment; filename=package.jpg" } };
const uploadBlobResponse =await blockBlobClient.uploadFile(filePath,blobOptions);
If there are other questions, please let me know!如果还有其他问题,请告诉我!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.