【发布时间】:2020-11-19 13:09:28
【问题描述】:
我正在尝试下载存储在具有私有访问权限的 azure blob 容器中的 word 文档,我需要将下载的文档转换为字节数组,以便能够发送到 react 应用程序
这是我在下面尝试的代码
[Authorize, HttpGet("{id}/{projectphase?}")]
public async Task<ActionResult<DesignProject>> GetDesignProject(string id, string projectphase = null)
{
var blobContainerName = Startup.Configuration["AzureStorage:BlobContainerName"];
var azureStorageConnectionString = Startup.Configuration["AzureStorage:ConnectionString"];
BlobContainerClient blobContainerClient = new BlobContainerClient(azureStorageConnectionString, blobContainerName);
blobContainerClient.CreateIfNotExists();
....... // not sure how to proceed further
.......
......
return new InlineFileContentResult('here i need to return byte array???', "application/docx") { FileDownloadName = fileName };
}
我得到了存储文件的完整路径名,如下所示
https://xxxx.blob.core.windows.net/design-project-files/99999-99/99999-99-BOD-Concept.docx
然后我也得到了文件名99999-99-BOD-Concept.docx
谁能指导我下一步如何下载文件,非常感谢我。
【问题讨论】:
标签: c# .net azure blob azure-blob-storage