Note that there are some explanatory texts on larger screens.

plurals
  1. POUpload blob block error with blockid > 1 char
    primarykey
    data
    text
    <p>I'm uploading a file to an Azure blob using VB.NET and the Azure .NET assemblies. As the file is large, I'm breaking it into blocks, and uploading with <code>CloudBlockBlob.PutBlock</code>. The problem I'm having is if I supply a <code>BlockID</code> which is longer than one character, I'm getting a "The specified blob or block content is invalid." error from <code>PutBLock</code>. If the blockID is only one charactor, it uploads fine.</p> <pre><code>Dim iBlockSize As Integer = 1024 ' KB Dim alBlockIDs As New ArrayList Dim iBlockID As Integer = 10 ' Create the blob client. Dim blobClient As CloudBlobClient = storageAccount.CreateCloudBlobClient() ' Retrieve reference to a previously created container. Dim container As CloudBlobContainer = blobClient.GetContainerReference("mycontainer") ' Retrieve reference to a blob named "myblob". Dim blockBlob As CloudBlockBlob = container.GetBlockBlobReference("myblob") Dim buffer(iBufferSize) As Byte fs.Read(buffer, 0, buffer.Length) Using ms As New MemoryStream(buffer) ' convert block id to Base64 Encoded string Dim b64BlockID As String = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(iBlockID.ToString(Globalization.CultureInfo.InvariantCulture))) ' write the blob block blockBlob.PutBlock(b64BlockID, ms, Nothing) alBlockIDs.Add(b64BlockID) iBlockID += 1 End Using </code></pre> <p>If <code>iBlockID = 1</code>, the <code>PutBlock</code> method works fine (I still need to address the blockID being the same length for each block, I'll worry about that later). Any ideas what's going on? I'm currently testing with the local Azure storage emulator.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload