我有将图像上传到 azure blob 存储的代码
这是上传图像的代码
public async Task<string> UploadFile(IFormFile file)
{
CloudStorageAccount storageAccount =
CloudStorageAccount.Parse(_configuration.GetConnectionString("AccessKey"));
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("toosee");
CloudBlockBlob blockBlob = container.GetBlockBlobReference(file.FileName);
using (var fileStream = file.OpenReadStream())
{
await blockBlob.UploadFromStreamAsync(fileStream);
}
return blockBlob.Uri.ToString();
}
结果我得到了网址
当我打开它时,图像下载。我只需要看一下,我的问题出在哪里?
阿波罗的战车
相关分类