BLOB文件必须手动重新命名,父文件夹的路径 [英] Blob files have to renamed manually to include parent folder path

查看:438
本文介绍了BLOB文件必须手动重新命名,父文件夹的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们是新的Windows Azure和已经使用的Windows Azure存储BLOB对象而开发sitefinity应用程序,但它是通过出版上传到这个存储BLOB文件从Visual Studio上传文件天青只有文件名,不维护在preFIX文件夹名称和斜杠。因此,我们必须手动重命名Windows Azure管理门户网站中的所有文件,把文件夹名称,并在每个文件名的开头斜线,使这是访问这些图片的页面可以显示正确,否则图像不因显示的图像不正确的路径。
 虽然在sitefinity管理面板,当我们在这些网页上载这些图像/ BLOB文件,我们上传到一个文件夹内,我们已经配置利用sitefinity使用Azure存储,而不是数据库。
请检查连接到见截图的文件。
请帮我解决这个问题。

We are new to Windows azure and have used Windows azure storage for blob objects while developing sitefinity application but the blob files which are uploaded to this storage via publishing to azure from Visual Studio uploads files with only the file names and do not maintain the prefix folder name and slash. Hence we have to rename all files manually on the windows azure management portal and put the folder name and slash in the beginning of each file name so that the page which is accessing these images can show the images properly otherwise the images are not shown due to incorrect path. Though in sitefinity admin panel , when we upload these images/blob files in those pages , we upload them inside a folder and we have configured to leverage sitefinity to use azure storage instead of database. Please check the file attached to see the screenshot. Please help me to solve this.

推荐答案

有几件事情,我想先提:

A few things I would like to mention first:


  1. Windows Azure中不支持重命名功能。重命名功能的blob =随后删除一滴一滴复制

  2. 复制BLOB操作是异步的,所以你必须等待复制操作删除BLOB之前完成。

  3. Blob存储不支持文件夹层次结构本身。正如你可能已经发现,可以通过$ P $创建一个文件夹的错觉与要文件夹的名称ppending BLOB名称(例如logo.png)(说图像),并将其与斜杠(/)所以你分开的blob名称将成为图像/ logo.png。

现在来到你的问题。不用说,手动重命名斑点将是一项繁琐的工作。我会建议使用的存储管理工具来做到这一点。其中一个例子是 Azure管理工作室 从Cerebrata。如果您使用的工具,基本上是你可以做的是在容器中创建一个空文件夹,然后将文件移动到该文件夹​​。这对我来说将是实现你的目标的最快方法。

Now coming to your problem. Needless to say that manually renaming the blobs would be a cumbersome exercise. I would recommend using a storage management tool to do that. One such example would be Azure Management Studio from Cerebrata. If you use that tool, essentially what you can do is create an empty folder in the container and then move the files into that folder. That to me would be the fastest way to achieve your objective.

如果你希望写一些code要做到这一点,在这里你将采取的步骤:

If you wish to write some code to do that, here are the steps you will take:


  1. 首先会列出所有BLOB的BLOB容器中。

  2. 接下来,您将遍历这个列表。

  3. 对于每个BLOB(我们称之为源BLOB),你会得到你想要它的名称和prePEND文件夹名称,并创建一个实例 CloudBlockBlob 对象。

  4. 接下来,您将开始使用上一滴复制BLOB操作<一个href=\"http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storage.blob.cloudblockblob.startcopyfromblob%28v=azure.10%29.aspx\"相对=nofollow> StartCopyFromBlob 在这个新的blob其中source是源一滴。

  5. 您将需要等待复制操作完成。一旦复制操作完成后,您可以安全地删除源一滴。

P.S。我会写一些code,但不幸的是我坚持用别的东西。我可能会写一些东西以后(但请不要屏住呼吸的:)。)

P.S. I would have written some code but unfortunately I'm stuck with something else. I might write something later on (but please don't hold your breath for that :)).

这篇关于BLOB文件必须手动重新命名,父文件夹的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆