SDK overview
S4 is compatible with the S3 protocol. To use any S3 SDK or tool, you only need to change the four settings below:
| Setting | Value |
|---|---|
| Endpoint | https://s3.bitiful.net |
| Region | cn-east-1 |
| Access Key ID | Sub-user AccessKey |
| Secret Access Key | Sub-user SecretKey |
Create keys in the console under Object Storage (对象存储) › Sub-users & Keys (子账户&Key). See Sub-users and AccessKeys.
A new sub-user has no permissions. Grant access to a bucket or directory first, or every request returns 403 AccessDenied.
Server-side SDKs
Each page covers uploads, multipart uploads, downloads, listing, copy and move, deletion, presigned URLs, S4 extension parameters, and error handling.
AWS SDK for JavaScript v3
AWS SDK for Go v2
Boto3
AWS SDK for Java 2.x
AWS SDK for PHP 3.x
AWS SDK for .NET 4.x
AWS SDK for Rust
AWS SDK for Ruby 3.x
Clients
Never embed an AccessKey in a web page, app, or mini program, and never deliver one through an API. Have your server issue presigned URLs so clients upload and download directly. For how this works, see Upload files securely from clients.
Direct uploads with progress, multipart uploads for large files
Kotlin and OkHttp
URLSession
Command-line tools
Upload, sync, and batch operations
Sync, migration, and mounting
Mount a bucket as a local folder
General notes
| Item | Notes |
|---|---|
| Addressing style | Both virtual-hosted style (bucket-name.s3.bitiful.net) and path style are supported; use the SDK default |
| Signature version | Use Signature V4. STS temporary credentials are not supported |
| Checksums | The default upload checksums of recent SDKs work as is; you do not need to disable Payload Signing |
| Listing | Each page returns 100 entries by default; use a paginator and do not assume everything is returned at once |
| Large files | Use multipart upload above 100 MB; each part is 5 MiB to 20 GiB, with up to 10000 parts |
| Conditional writes | If-None-Match and If-Match are supported. See Conditional requests |
| Move | Native move is supported. See Move and rename objects |
| Retries | The SDK retries 5xx responses automatically; rate limiting returns 429, which some SDKs do not retry automatically, so handle it yourself |
| Client reuse | Clients in every language can be used concurrently; create one per process |
For the support status of each operation, see S3 API compatibility.
Why we recommend the S3 protocol
S3 is the de facto standard for object storage, supported by Alibaba Cloud OSS, Tencent Cloud COS, Qiniu Kodo, AWS S3, Cloudflare R2, and others.
Standardizing your team on the S3 protocol avoids lock-in to a single vendor: switching storage only requires changing the endpoint and keys.