【问题标题】:Can't delete blob from windows azure storage when filename ends in question mark当文件名以问号结尾时,无法从 Windows azure 存储中删除 blob
【发布时间】:2013-02-15 00:48:26
【问题描述】:

我已尝试从 Windows azure 管理门户中删除一些以 .jpg?12312223 和 .jpg?zz=23(随机数)结尾的文件,但始终无法正常工作。我还尝试从 CloudBerry Explorer for Azure Blob Storage 中删除它们并收到错误。

有什么办法可以删除这些文件吗?

谢谢。

【问题讨论】:

    标签: azure azure-storage azure-blob-storage


    【解决方案1】:

    如果您正在寻找其他工具来执行此操作,我建议您试试 Cerebrata (http://www.cerebrata.com) 的 Azure Management Studio。该工具目前处于公测阶段,可以从 Cerebrata 的网站主页下载(披露:我是 Cerebrata 团队的一员)。

    如果您尝试通过存储客户端库来执行此操作,您可以尝试以下方式:

            CloudStorageAccount storageAccount = CloudStorageAccount.DevelopmentStorageAccount;
            CloudBlobContainer blobContainer = storageAccount.CreateCloudBlobClient().GetContainerReference("images");
            CloudBlockBlob blobWithSpecialCharacters = blobContainer.GetBlockBlobReference("filename.txt?j=123123");
            using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes("This is sample text")))
            {
                blobWithSpecialCharacters.UploadFromStream(ms);
            }
            blobWithSpecialCharacters.Delete();
    

    【讨论】:

    • 谢谢!我使用了你的软件,它比 CloudBerry 运行得更好、更快。
    • Gaurav 对 Azure 存储的每个回答都是正确的,值得点赞。这么长时间以来,没有人在如此详细的水平上工作过。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-13
    • 2021-12-12
    • 1970-01-01
    • 2019-12-15
    • 2023-01-16
    • 2013-08-28
    • 2016-05-04
    相关资源
    最近更新 更多