gpt4 book ai didi

php - Windows Azure Blob 存储。 (点)在对象名称中被忽略

转载 作者:行者123 更新时间:2023-12-03 01:09:27 25 4
gpt4 key购买 nike

我在项目中使用 Windows Azure Blob 存储来存储数据。我上传文件和文件夹。文件夹只是 0 大小的对象,名称以“/”结尾

我发现如果我尝试用“zzz”命名文件夹。然后在 azure 上我会得到“zzz”(.被删除)另外,z.z.z。转换为 zzz,但 z.z.z 未转换。所以,看起来像。对象名称末尾的所有点都被删除。

请求就像

PUT myblob.blob.core.windows.net/myblobtop/zzz.?timeout=30
headers:
[Content-Encoding] =>
[Content-Language] =>
[Content-Length] => 0
[Content-MD5] =>
[Content-Type] => application/directory
[x-ms-version] => 2009-09-19
[Connection] => Keep-Alive
[x-ms-blob-type] => BlockBlob

然后有一个名为 myblobtop/zzz 的对象,no 。最后

有谁知道这是什么以及如何解决?也许需要一些 url 编码来进行编码。最后?

我使用此 API 调用添加文件夹 https://msdn.microsoft.com/en-us/library/azure/dd179451.aspx

最佳答案

您不能拥有 .在 blobname 的末尾:

Blob Names

A blob name must conforming to the following naming rules: A blob name can contain any combination of characters. A blob name must be at least one character long and cannot be more than 1,024 characters long.

Blob names are case-sensitive.

Reserved URL characters must be properly escaped. The number of path segments comprising the blob name cannot exceed 254. A path segment is the string between consecutive delimiter characters (e.g., the forward slash '/') that corresponds to the name of a virtual directory. System_CAPS_noteNote

Avoid blob names that end with a dot (.), a forward slash (/), or a sequence or combination of the two.

The Blob service is based on a flat storage scheme, not a hierarchical scheme. However, you may specify a character or string delimiter within a blob name to create a virtual hierarchy. For example, the following list shows valid and unique blob names. Notice that a string can be valid as both a blob name and as a virtual directory name in the same container:

/a

/a.txt

/a/b

/a/b.txt

You can take advantage of the delimiter character when enumerating blobs.

Naming and Referencing containers

关于php - Windows Azure Blob 存储。 (点)在对象名称中被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35288367/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com