大家好,更新Azure存储blob属性会出错. [英] Hi All,Updating Azure Storage blob properties gives error.
问题描述
您好,更新Azure存储blob属性会出错.
Hi All,Updating Azure Storage blob properties gives error.
我尝试了以下代码,但始终会收到参数不正确"的错误消息,请您告诉我有什么问题 代码吗?
I tried the below code but always get an error as "Parameter is incorrect", can you please tell me whats wrong with the code?
CloudStorageAccount storageAccount = CloudStorageAccount.Parse("xxxxxxxxxxxxxxxxxxxxxxx");
// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve reference to a previously created container.
//CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");
CloudBlobContainer container = blobClient.GetContainerReference("bpglobe");
CloudBlockBlob blockBlob = container.GetBlockBlobReference(@"23_S_America\01_Present_Day_GDE_Maps\Local_Maps\Colombia_Lanos region_GDEs_1999.pdf");
blockBlob.Properties. ContentType = "application/pdf";
推荐答案
我不确定您的帖子中是否存在复制和粘贴错误,但是我可以看到在为blockBlob.Properties设置属性时,您缺少了右引号()和分号(;). CacheControl
I'm not sure if it is a copy and paste error in your post, but I can see that you are missing a closing quote (") and semicolon (;) when setting the property for blockBlob.Properties.CacheControl
您的代码还缺少这个吗?
Is your code also missing this?
如果此答案有帮助,请单击标记为答案"或向上投票.要提供有关您的论坛体验的其他反馈,请单击 此处
If this answer was helpful, click "Mark as Answer" or Up-Vote. To provide additional feedback on your forum experience, click Here
这篇关于大家好,更新Azure存储blob属性会出错.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!