Problem description
The Base64-encoded value of the Callback parameter in the request is invalid.
Causes
You initiated a request in which the Base64-encoded value of the Callback parameter that specifies upload callback is invalid. As a result, the error is returned. The format requirement applies to the Callback parameter in URL-based requests, the x-oss-callback
field in request headers, and the form field named callback in Post requests. The value of the Callback parameter in a request must be a JSON string encoded in the Base64 format. If the server that receives the request fails to decode the Base64-encoded string, the error is returned.
Examples
The following code provides a sample request in which the value of the x-oss-callback field is invalid:
PUT /test.txt HTTP/1.1
Host: callback-test.oss-cn-hanghzou.aliyuncs.com
Content-Length: 4
x-oss-callback-var: eyJ4Om15X3ZhciI6ImZvci1jYWxsYmFjay10ZXN****=
x-oss-callback: x123-*&
Date: Sun, 19 Feb 2023 09:42:14 GMT
Content-Type: text/plain
Authorization: OSS qn6q**************:77Dv****************
Test
In the preceding request, the value of the x-oss-callback
field is x123-*&
, which is not a valid Base64-encoded JSON string. As a result, the error is returned.
Solutions
Make sure that the value of the Callback parameter in your request is a JSON string that is encoded in the Base64 format. For information about how to construct a Callback request, see Callback.
References
For information about the principles of the upload callback feature and how to use the feature, see Upload callbacks and Callback.
For information about the common errors that you may encounter when you configure upload callback and the causes of the errors, see Upload callback errors and troubleshooting.
For information about how to obtain signature information from the server in various programming languages based on POST policies, configure upload callback, and then directly upload data to Object Storage Service (OSS) by using form upload, see Overview.
For information about how to set up an OSS-based direct data transfer service for mobile apps and configure upload callback, see Set up upload callback for mobile apps.