我想在我的blob中創建一些子目錄。但它不工作了好Windows Azure:在blob中創建一個子目錄
這裏是我的代碼
protected void ButUpload_click(object sender, EventArgs e)
{
// store upladed file as a blob storage
if (uplFileUpload.HasFile)
{
name = uplFileUpload.FileName;
// get refernce to the cloud blob container
CloudBlobContainer blobContainer = cloudBlobClient.GetContainerReference("documents");
if (textbox.Text != "")
{
name = textbox.Text + "/" + name;
}
// set the name for the uploading files
string UploadDocName = name;
// get the blob reference and set the metadata properties
CloudBlockBlob blob = blobContainer.GetBlockBlobReference(UploadDocName);
blob.Metadata["FILETYPE"] = "text";
blob.Properties.ContentType = uplFileUpload.PostedFile.ContentType;
// upload the blob to the storage
blob.UploadFromStream(uplFileUpload.FileContent);
}
}
我所做的是,如果我要創建一個子目錄,我會在文字框中輸入子目錄的名稱。
例如,如果我需要創建一個名爲文件「的test.txt」的分目錄內「文件」 然後,我textbox.text =文件和uplFileUpload.FileName =測試。 TXT
現在我將它們連接起來,並上傳到BLOB .. 但它不工作以及.. 我想起來了 https://test.core.windows.net/documents/files/
我沒有得到整個事情 我期待https://test.core.windows.net/documents/files/test.txt
我在做什麼錯... 如何創建BLOB中的子目錄。