Torch Object Storage
Parameter | Description | Constraints and limitations |
Parameter | Description | Constraints and limitations |
callbackUrl | Indicates the URL of the third‑party application server to which TOS will send an HTTP or HTTPS request after a successful upload. |
|
callbackHost | Represents the HOST header of the callback request. The value of this field overrides the host derived from callbackUrl. |
|
callbackBody | Represents the body sent with the callback request. Its format must match the content type specified by callbackBodyType. |
|
callbackBodyType | Indicates the content type of the callback request. This field must be used with callbackBody. |
|
Variable | Type | Description |
Variable | Type | Description |
bucket | string | The name of the bucket to which the object was uploaded. |
key | string | The name of the uploaded object. |
object | string | The name of the uploaded object. |
size | int64 | The size of the uploaded object. |
etag | string | The ETag of the uploaded object. |
crc64ecma | string | The CRC-64 value of the uploaded object. |
versionId | string | The version ID of the uploaded object, available only when versioning is enabled for the bucket. |
filename | string | The name of the file that was uploaded to TOS via the PostObject API |
fname | string | The name of the file that was uploaded to TOS via the PostObject API |
mimeType | string | The content type that the client specified when uploading an object. If not specified, the default is "binary/octet-stream". |
requestId | string | The ID of this request. |
Supported APIs | How callback parameters are passed | Where to include | Signing method | Constraints and limitations |
Supported APIs | How callback parameters are passed | Where to include | Signing method | Constraints and limitations |
PutObject and CompleteMultipartUpload | Through request headers | Request headers:
| Includes signatures in CanonicalQueryString and SignedHeaders according to the signature mechanism. |
|
| Through the URL | Query strings:
| | |
PostObject | Using POST form fields |
| Includes x-tos-callback, x-tos-callback-var, and custom variables as conditions in the policy for form-based uploads, according to the signature mechanism for form uploads. |
|
Category | Requirement |
Category | Requirement |
Interface protocol | HTTP or HTTPS. When using HTTPS, the third-party application must have a valid certificate. |
Request method | POST |
Request body format | application/x-www-form-urlencoded or application/json |
Response status code | 200 |
Request body format | application/json |
Response body size | No larger than 3 MB. |
HTTP status code | Error codes | Error message |
HTTP status code | Error codes | Error message |
203 | CallbackFailed | The upload was successful, but the callback request to the third-party application server failed. Possible reasons for this failure include a DNS error, a request timeout, or invalid response content. |
400 | InvalidCallbackArgument |
|
403 | AccessDenied | Verification of the callback parameters and custom variables against the PostObject request policy document has failed. |