Mithilfe von Unterverzeichnissen im Windows Azure-Blob-Speicher

Ich versuche zum hochladen einer Datei in den Windows Azure-blob-Speicher. Von meinem Verständnis, die Sie hochladen können Dateien in so etwas ähnliches wie ein Unterverzeichnis. Ich möchte eine Datei hochladen, blob, so dass die Datei im wesentlichen befindet sich in /TestContainer/subDirectory1/subDirectory2/file.png

//Setup the Windows Aure blob client
CloudStorageAccount storageAccount = CloudStorageAccount.FromConfigurationSetting("BlobStorage");
CloudBlobClient client = storageAccount.CreateCloudBlobClient();

//Retrieve the TestContainer container from blob storage
CloudBlobContainer container = client.GetContainerReference("TestContainer");
if (container.CreateIfNotExist())
  container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });

//Setup the blob
CloudBlob blob = container.GetBlobReference("");

//Create the meta data for the blob
NameValueCollection metadata = new NameValueCollection();
metadata["id"] = fileID.ToString();
blob.Metadata.Add(metadata);

//Store the blob 
byte[] bytes = GetFileBytes();
blob.UploadByteArray(bytes);

Wie lade ich eine Datei mit Verzeichnis-Struktur??? Der link hier erwähnt, es gibt einen Weg, es zu tun. Jedoch, ist es nicht zeigen Ihnen, wie Sie es tun.

Danke!

Schreibe einen Kommentar