All Products
Search
Document Center

Object Storage Service:0007-00000026

Last Updated:Jul 21, 2023

Problem description

The value of the additionalHeaders field in the callback parameter is invalid. The callback parameter is used to request callbacks.

Causes

The Base64-encoded callback parameter in the request is used to request upload callbacks. After the parameter is decoded, the result is in the JSON format. The additionalHeaders field that is contained in the decoded value specifies additional request headers and must be in the Map format. The keys in the additionalHeaders value cannot start with x-oss-. Otherwise, an error is returned.

Examples

The following code shows a sample result after the value of the callback parameter is decoded:

{
	"callbackUrl":"www.oss-callback.com/test.php",
	"callbackBody":"{\"mimeType\":${mimeType},\"size\":${size}}",
  "additionalHeaders": {
    "x-oss-test": "val1",
    "key2": "val2"
  }
}

In the preceding code, the first key in the dictionary of the additionalHeaders field is x-oss-test. The key contains an invalid prefix. As a result, an error is returned.

Solutions

Make sure that the additional headers in the additionalHeaders field are in the Map format and each key of the additionalHeaders value does not start with x-oss-. Example:

{
	"callbackUrl":"www.oss-callback.com/test.php",
	"callbackBody":"{\"mimeType\":${mimeType},\"size\":${size}}",
  "additionalHeaders": {
    "key1": "val1",
    "key2": "val2"
  }
}

References

  • For information about the principles of the upload callback feature and how to use the feature, see Upload callbacks and Callbacks.

  • For more information about the common errors that you may encounter when you configure upload callbacks and the causes of these errors, see Upload callbacks.

  • For more information about how to obtain signature information from the server in various programming languages based on POST policies, configure upload callbacks, and then directly upload data to Object Storage Service (OSS) by using forms, see Overview.

  • For more information about how to set up an OSS-based direct data transfer service for mobile apps and configure upload callbacks, see Set up upload callbacks for mobile apps.