Problem description
The key of a user metadata header contains invalid characters.
Causes
User metadata is a set of key-value pairs attached to an object. Keys must start with x-oss-meta- and can only contain the following characters:
Letters (a–z, A–Z)
Digits (0–9)
Hyphens (
-)
Underscores (_) and other characters are not supported.
Note: Uppercase letters in keys are automatically converted to lowercase. For example,x-oss-meta-MyKeybecomesx-oss-meta-mykey.
Examples
The following table shows valid and invalid user metadata key examples.
| Key | Valid | Reason |
|---|---|---|
x-oss-meta-location | Yes | |
x-oss-meta-last-modified | Yes | |
x-oss-meta-my_key | No | Underscore not allowed |
x-oss-meta-my key | No | Space not allowed |
location | No | Missing x-oss-meta- prefix |
Solutions
Check the user metadata keys in your request and make sure each key meets the following requirements:
Starts with
x-oss-meta-Contains only letters, digits, and hyphens
You can specify multiple user metadata headers for a single object. The total size of all user metadata for an object cannot exceed 8 KB.
References
该文章对您有帮助吗?