Client upload enables mobile apps, web pages, and mini programs to upload media files directly to an Object Storage Service (OSS) bucket managed by ApsaraVideo VOD. Files bypass your application server entirely, reducing server bandwidth costs and simplifying your architecture. Because permanent AK/SK credentials must not be embedded in client applications, the client upload SDK uses short-lived upload credentials issued by your backend authorization service (AppServer) to authenticate each upload session.
How client upload works
The client upload SDKs are built on top of the OSS SDK. When a client uploads a file, the SDK handles all the underlying multipart upload and resumable upload logic. The file travels directly from the client device to the ApsaraVideo VOD OSS bucket. Your AppServer only issues credentials and never touches the file content.
Client upload follows a three-stage process:
The client sends an HTTP request to your AppServer with media metadata (such as
Title,FileName,CateId, andTags).The AppServer obtains an upload credential from VOD or STS and returns it to the client.
The client uses the credential to upload the file directly to OSS. After the upload completes, the SDK triggers a success callback and VOD automatically initiates transcoding and processing pipelines.
Core features
Multipart upload
Multipart upload splits large files into smaller parts and uploads them in parallel. This improves both upload speed and reliability for large media files, since a network failure only requires retrying the failed parts rather than re-uploading the entire file. Multipart upload is enabled by default across all client upload SDKs and requires no additional configuration.
Resumable upload
Resumable upload allows the SDK to continue an interrupted upload from the last successfully uploaded part instead of restarting from the beginning. When a network disconnection, app backgrounding, or device sleep interrupts an upload, the SDK stores checkpoint data internally. Once the connection is restored and the app resumes, the SDK automatically resumes from the checkpoint without developer intervention.
Upload control
The upload SDK provides programmatic APIs to start, stop, pause, and resume individual uploads. This is useful when you need to respect user-initiated actions, such as canceling an upload when the user navigates away, or manage upload concurrency in batch scenarios. You control the upload lifecycle entirely through SDK method calls.
Progress callbacks
The SDK exposes granular progress callbacks that report the percentage of data uploaded for each file. Use these callbacks to update progress bars, display upload speeds, or trigger conditional logic, such as disabling certain UI elements while an upload is in progress. Progress callbacks fire at regular intervals during the upload, providing real-time visibility into transfer status.
Network switching
Mobile clients frequently transition between Wi-Fi and cellular networks. The SDK supports pausing and resuming uploads to handle these transitions. To avoid consuming mobile data, call the pause method when the device switches to a mobile network and call the resume method when Wi-Fi is restored. Your application must implement the network transition detection logic.
Batch upload
The SDK manages an upload queue that supports adding, removing, canceling, resuming, and traversing multiple files. You can clear the entire queue or manipulate individual entries. Batch upload is useful in scenarios where users select multiple media files at once, such as a photo gallery upload, and the SDK schedules them sequentially or in parallel based on available resources.
Metadata support
When obtaining upload credentials, you can attach metadata to the media asset being uploaded. Supported metadata fields include Title, Tags, CateId, CoverURL, TemplateGroupId, and WorkflowId. Setting metadata at the credential stage ensures that the media asset is immediately associated with the correct category, tags, and processing workflow upon upload completion, eliminating the need for a separate API call to update media properties.
Supported platforms and versions
Platform | Current version | Minimum system requirement |
Web (JavaScript) | Modern browsers (Chrome, Safari, Firefox, Edge) | |
Android | Android 5.0+ | |
iOS | iOS 12.0+ | |
WeChat mini program | WeChat base library 2.x+ |
For the latest version numbers and download links, see the Release notes of the upload SDKs.
Privacy compliance and billing
Privacy compliance
The client upload SDK is designed to be embedded in applications distributed through app stores. The SDK collects no personal data. For compliance requirements when distributing apps with SDK integrations, refer to the Service Agreement.
Billing
The client upload SDK itself is free to use. Costs are associated with the ApsaraVideo VOD resources consumed during and after upload:
Billing item | Description |
Storage fees | Billed by the storage volume of uploaded media files and the duration of storage. |
Traffic fees | Upload traffic (inbound traffic from client to OSS) is free. Downstream playback traffic is billed separately. |
Transcoding fees | If transcoding is triggered after upload, you are charged based on output file duration and transcoding specification. No charge applies if transcoding is not performed. |
Upload acceleration fees | Billed by accelerated data volume on a pay-as-you-go basis when upload acceleration is enabled. For pricing information, see Billing overview. Contact your sales representative for consultation. |
Upload traffic (inbound traffic from the client to OSS) is not charged. For more information about VOD billing, see Billing overview.