All Products
Search
Document Center

Object Storage Service:0007-00000004

Last Updated:Jul 21, 2023

Problem description

The value of the callbackUrl 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 callbackUrl field that is contained in the decoded value must be a valid URL. Otherwise, an error is returned.

The callbackUrl field contains the destination URLs to which Object Storage Service (OSS) sends callback requests after objects are successfully uploaded to OSS. The callbackUrl field must meet the following requirements:

  • The callbackUrl field can contain up to five URLs. Multiple URLs are separated by semicolons (;). OSS sends requests to the URLs in sequence until a success response is returned.

  • If you do not configure this field or if you leave this field empty, callback is not configured.

  • HTTPS URLs are supported.

  • To ensure that Chinese characters can be correctly processed, the callbackUrl value must be encoded into the URL format.

If a URL in the callbackUrl field is invalid, an error is returned.

Examples

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

{
"callbackUrl":"www.callback-example.com:test",
"callbackBody":"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&imageInfo.height=${imageInfo.height}&imageInfo.width=${imageInfo.width}&imageInfo.format=${imageInfo.format}&my_var=${x:my_var}"
}

The value of the callbackUrl field is www.callback-example.com:test, which is not a valid URL. The location of test needs be populated by a port number that must be a positive integer. In this case, an error is returned.

Solutions

Make sure that the values of the callbackUrl field in the callback parameter are valid URLs. The Chinese characters in the values must be encoded into the URL format if Chinese characters exist.

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.