This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async Task<string> UploadBlobStorage(IFormFile filepayupload) | |
{ | |
string url = string.Empty; | |
if (filepayupload != null) | |
{ | |
using (var stream = new MemoryStream()) | |
{ | |
await filepayupload.CopyToAsync(stream); | |
var streamArray = stream.ToArray(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<byte[]> GetImageAsByteArray(string imageFilePath) | |
{ | |
CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(connectionStorage); | |
CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient(); | |
CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference (containerReferrence); | |
CloudBlob cloudBlob = cloudBlobContainer.GetBlobReference(new CloudBlockBlob(new Uri(imageFilePath)).Name); | |
await cloudBlob.FetchAttributesAsync(); | |
long fileByteLength = cloudBlob.Properties.Length; | |
Byte[] myByteArray = new Byte[fileByteLength]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install-Package WindowsAzure.Storage -Version 9.2.0 |