SetBlobMetadata Method
Sets the user-specified metadata for a blob.
Syntax
int SetBlobMetadata(char* lpszblobName);
Remarks
This method will set the user-specified metadata within Metadata for the blob specified by blobName and stored within the container ContainerName.
If the blob has an active lease, LeaseId must be specified prior to calling SetBlobMetadata.
To set the properties of a blob, SetBlobProperties can be set to true prior to calling SetBlobMetadata. The following properties can be set for a blob:
- x-ms-blob-cache-control
- x-ms-blob-content-type
- x-ms-blob-content-md5
- x-ms-blob-content-encoding
- x-ms-blob-content-language
Note that all properties must be specified using OtherHeaders and are separated by CRLF ("\r\n")
.
For example in C#:
blob.OtherHeaders = "x-ms-blob-content-type: my_content_type\r\ n" + "x-ms-blob-content-encoding: my_encoding"
Note both blob metadata and properties cannot be set at the same time and thus must be done using two separate SetBlobMetadata calls. Therefore you must set SetBlobProperties and Metadata or OtherHeaders accordingly (based on the operation you wish to perform).