Problem description
The `Callback` parameter in the request is not a valid Base64-encoded string.
Causes
This error occurs because the server-side fails to decode the `Callback` parameter, whose value must be a Base64-encoded JSON string. The `Callback` parameter can be the `callback` parameter in the URL, the x-oss-callback field in the request header, or the `callback` form field in a Post request.
Examples
For example, you send the following request:
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 x-oss-callback header is set to x123-*&. This value is not a valid Base64-encoded string and causes the error.
Solutions
Ensure that the `Callback` parameter in the request is a Base64-encoded JSON string. For more information about how to construct the request, see the Callback document.
References
-
For more information about the principles and usage of upload callbacks, see Upload callbacks and Callback.
-
For more information about common errors and troubleshooting for upload callbacks, see Upload callback errors and troubleshooting.
-
For more information about how to sign requests on the server-side, set upload callbacks, and directly upload data to OSS using a form based on PostObject policies, see Overview of server-side signing for direct upload and setting upload callbacks.
-
For more information about how to build an OSS-based service for direct data upload from mobile applications and set upload callbacks, see Quickly build an upload callback service for mobile applications.