Roman Gelembjuk
Roman Gelembjuk

Reputation: 2005

Windows Azure Blob Storage . (dot) is ignored in an object name

I use Windows Azure Blob Storage in my project to store data. I upload files and folders. Folders are just 0 size object with a name ending with '/'

I found that if i try to name a folder with "zzz." then on azure i will get "zzz" (. is removed) Also, z.z.z. is converted to zzz, but z.z.z is not converted. So , it looks like . in the end of object name makes all dots are removed.

Request is like

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

and then there is object named myblobtop/zzz, no . in the end

Does anyone know what is this and how to solve? Maybe some url encoding to encode . in the end?

I add folders with this API call https://msdn.microsoft.com/en-us/library/azure/dd179451.aspx

Upvotes: 1

Views: 755

Answers (1)

Peter
Peter

Reputation: 27944

You can not have a . in the end of the 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

Upvotes: 3

Related Questions