- Documentation
Torch Object Storage
SDK Reference
Browser.js
Upload Object
Standard Upload (Browser.js SDK)
Upload Object
Standard Upload (Browser.js SDK)
Standard Upload (Browser.js SDK)
When the file you upload is smaller than 5 GiB, you can use the simple upload method (that is, the PutObject method) to upload files or data to TOS.
Notes
- To prevent exposure of your Volcengine account credentials (namely, AccessKey ID and AccessKey Secret) in browser environments, it is strongly recommended to perform TOS operations using temporary access credentials. For detailed instructions, please refer to Using STS Temporary AK/SK+Token to Access Volcengine TOS.
- Endpoint is the access domain name for TOS external services. For information on endpoints supported by TOS, please refer to Access Domain Endpoint.
- When uploading objects, object names must comply with specific standards. For detailed information, please refer to Object Naming Guidelines.
- TOS is a distributed object storage product designed for large-scale data storage, with internal partitions that store object index data. To maximize the throughput when uploading and downloading objects and to reduce the likelihood of hot partitions, please avoid using object names that increase in lexicographical order. For more details, see Performance Optimization.
- If an object with the same name already exists in the bucket, the new object will overwrite the existing one. If versioning is enabled for your bucket, the original object will be retained, and a new version number will be generated to identify the newly uploaded object.
Sample Code
The following code is used to upload data to the file exampleobject.txt located in the exampledir directory of examplebucket.
Last updated: 2025.09.22 18:55:46