Azure Blob Storage Upload File.Net Core

protected override Task SaveThumb(string thumbFilePath, string thumbFileName, byte[] binary)

{

if (binary.Length>0)

{

Stream stream = new MemoryStream(binary);

var serviceClient = new BlobServiceClient(_config.AzureBlobStorageConnectionString);

var containerClient = serviceClient.GetBlobContainerClient(_config.AzureBlobStorageContainerName);

var blobClient = containerClient.GetBlobClient(thumbFileName);

blobClient.UploadAsync(stream, true);

stream.Close();

return Task.CompletedTask;

}

return Task.CompletedTask;

}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store