SalimAzureBlobAPI/SalimAzureAPI/AzureBlobManager.cs
/// <summary>
/// Downloads the contents of a blob into a byte[]
/// </summary>
/// <param name="containerName">The blob's container</param>
/// <param name="blobName">The name of the blob to download</param>
/// <returns>byte[] with the blob's contents</returns>
Downloads the contents of a blob into a byte[]
Downloads the contents of a blob into a byte []
public byte[] GetBlob(string containerName, string blobName)
        {
            CloudBlobContainer container = _blobClient.GetContainerReference(containerName);
            _blockBlob = container.GetBlockBlobReference(blobName);
            _blockBlob.FetchAttributes();
            long fileByteLength = _blockBlob.Properties.Length;
            byte[] fileContents = new byte[fileByteLength];
            _blockBlob.DownloadToByteArray(fileContents, 0);
            return fileContents;
        }
public byte [ ] GetBlob ( string containerName , string blobName ) { CloudBlobContainer container = _blobClient . GetContainerReference ( containerName ) ; _blockBlob = container . GetBlockBlobReference ( blobName ) ; _blockBlob . FetchAttributes ( ) ; long fileByteLength = _blockBlob . Properties . Length ; byte [ ] fileContents = new byte [ fileByteLength ] ; _blockBlob . DownloadToByteArray ( fileContents , 0 ) ; return fileContents ; }
Downloads the contents of a blob into a byte[]
Downloads the contents of a blob into a byte []
byte[] with the blob's contents
byte [] with the blob ' s contents
containerName
string
The blob's container
The blob ' s container
blobName
string
The name of the blob to download
The name of the blob to download