You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Pre-signature Mechanism
Pre-signed POST Form (Browser.js SDK)
Copy page
Download PDF
Pre-signed POST Form (Browser.js SDK)
This article provides example code for presigned POST forms.​
Sample Code​
The following code is used for using a presigned POST form to bucket. When adding the object preSignedUrl-put.txt to examplebucket, generate the corresponding POST form signature data.​
​
<!DOCTYPE html>​
<html lang="en">​
<head>​
<meta charset="UTF-8" />​
<title>Document</title>​
</head>​
<body>​
<script src="https://tos-public.volccdn.com/obj/volc-tos-public/@volcengine/tos-sdk@latest/browser/tos.umd.production.min.js"></script>​
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.4.0/axios.min.js"></script>​
<script type="text/javascript">​
const client = new TOS({​
region: yourRegion,​
endpoint: yourEndpoint,​
accessKeyId: yourAccessKey,​
accessKeySecret: yourSecretKey,​
stsToken: yourSecurityToken,​
bucket: examplebucket,​
});​
const objectName = 'exampledir/preSignedUrl-put.txt';​
​
const main = async () => {​
const result = await client.preSignedPostSignature({​
bucket: examplebucket,​
key: objectName,​
});​
console.log('preSignedPostSignature:', result);​
};​
​
main();​
</script>​
</body>​
</html>​
​
Related documentation​
For detailed information about presigned POST forms, see Forms for browser-based uploads that contain a signature.​
Last updated: 2025.09.22 18:55:46