Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to download blob as byte array, but above mention error occur. my code is as follow


Dim fullFileBytes() As Byte = {}
Dim objAzureStorage As New AzureCloudStorage

                           Dim fullImageBlob As Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob = objAzureStorage.CloudContainer.GetBlockBlobReference(row(0))

                           fullImageBlob.DownloadToByteArray(fullFileBytes, 0)


What I have tried:

I have get stream of blob and convert it into byte.
Posted
Updated 7-Apr-17 0:05am

1 solution

Your byte array is zero length, which means it isn't big enough to hold any bytes, much less whatever blob size you are retrieving. You need to allocate an array big enough to hold the blob, not pass a zero length array and hope for the best!

See here: Azure Blob Storage Part 3: Using the Storage Client Library - Simple Talk[^] - the code is in C#, but online convertes will sort that for you: Code Converter[^]
 
Share this answer
 
Comments
Sajid227 7-Apr-17 6:53am    
thanx Genius of search.
OriginalGriff 7-Apr-17 7:09am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900