Skip to content

Commit

Permalink
Possibilité d'upload en b64
Browse files Browse the repository at this point in the history
  • Loading branch information
titouancreach committed Oct 7, 2022
1 parent 77fe7bb commit f340f50
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Helpers/FluentBlobStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ public FluentBlobStorage WithContentType(string contentType)
return (blobClient.Uri, res);
}

public async Task<(Uri, Azure.Response<BlobContentInfo>)> UploadAsync(string b64)
{
AssertGuards();

BlobServiceClient blobServiceClient = new(ConnectionString);
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(ContainerName);
BlobClient blobClient = containerClient.GetBlobClient(FileName);

var res = await blobClient.UploadAsync(Convert.FromBase64String(b64), Headers);

return (blobClient.Uri, res);
}


public (Stream, BlobProperties) OpenRead()
{
AssertGuards();
Expand Down

0 comments on commit f340f50

Please sign in to comment.