- Documentation
Torch Object Storage
SDK Reference
PHP
Pre-signed URLs (PHP SDK)
PHP
Pre-signed URLs (PHP SDK)
Pre-signed URLs (PHP SDK)
You can generate a pre-signed URL using TosClient->preSignedURL, and then use the generated pre-signed URL to directly send HTTP or HTTPS requests to access TOS services, enabling operations such as uploading and downloading objects.
Uploading Objects Using Pre-Signed URLs
When uploading an object using a pre-signed URL, you must specify the request method as Enum::HttpMethodPut. The following is sample code:
Downloading Objects Using Pre-Signed URLs
When downloading an object using a pre-signed URL, you must specify the request method as Enum::HttpMethodGet. The following is sample code:
Generate Pre-Signed URLs for Image Transcoding and Video Frame Extraction
When downloading an object using a pre-signed URL, you can additionally include the x-tos-process parameter in the request, which indicates that image transcoding or video frame extraction will be performed. The following is sample code:
Last updated: 2025.09.23 14:41:21