简体   繁体   中英

Uploading a picture to Windows Azure blob storage

I'm trying to upload a picture to Windows Azure blob storage. I found a good example, but it relied on the Microsoft.WindowsAzure.StorageClient assembly. I've just learned that the latest version of the Windows Azure SDK has a new Microsoft.WindowsAzure.Storage assembly, which replaces the older StorageClient assembly. This new assembly uses new concreate types: CloudPageBlob and CloudBlockBlob . With the new assembly, I used the following:

// Setup the blob
string blobAddress = "myPicture.png";
CloudBlob blob = container.GetBlobReference(blobAddress);
blob.Properties.ContentType = "image/png";

With the new assembly though, I'm not sure what to use. If I'm uploading an image into blob storage, is it a page blob or a block blob? I don't understand the difference between the two. At the same time, I can't find information about the difference between the two. Can someone please help me out?

Old library's CloudBlob.Upload* methods upload to block blobs. Hence, when updating your application to use the new library, you can use a CloudBlockBlob instead.

For more information on block blobs and page blobs, please refer to Understanding Block Blobs and Page Blobs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM