This topic describes how to obtain upload URLs and credentials when you use client upload SDKs to upload media files. The upload URLs and credentials are used to initialize upload instances.

Background information

When you upload medial files from clients, the files are directly uploaded to Object Storage Service (OSS) buckets allocated by ApsaraVideo VOD without forwarding by servers. Therefore, the clients must be authenticated. You must deploy an authorization service on your application server to obtain upload URLs and credentials. Client upload SDKs support the following authorization methods:
  • Authorization based on upload URLs and credentials.
  • Authorization based on Security Token Service (STS) tokens.

Upload URLs and credentials are issued by ApsaraVideo VOD to authorize users to upload media files to OSS buckets allocated by ApsaraVideo VOD. Using upload URLs and credentials to upload media files is more advantageous over using STS. For more information about the advantages, see Comparison between credentials and STS. For more information about how to use STS tokens to upload media files, see Obtain an STS token.

Upload process

For more information about the upload process, see Upload processes.

Obtain upload URLs and credentials

We recommend that you integrate a server operation SDK of ApsaraVideo VOD to obtain upload URLs and credentials. This way, you do not need to calculate signatures yourself. The process varies based on the programming language you use. The following table describes the references for different programming languages.

Programming language References
Java
  1. Installation
  2. Initialization
  3. Media upload
Python
  1. Installation
  2. Initialization
  3. Media upload
PHP
  1. Installation
  2. Initialization
  3. Media upload
.NET
  1. Installation
  2. Initialization
  3. Media upload
Node.js
  1. Installation
  2. Initialization
  3. Media upload
Go
  1. Installation
  2. Initialization
  3. Media upload
C or C++
  1. Installation
  2. Initialization
  3. Media upload

Use upload URLs and credentials

Each file requires an upload URL and an upload credential. Therefore, you must obtain the upload URL and credential from the AppServer in the onUploadStarted callback and specify them in the upload instance. The process varies based on the environment you use. The following table describes the references for different environments.

Environment References
Web Upload SDK for JavaScript
Android Upload SDK for Android
iOS Upload SDK for iOS
WeChat mini program Upload SDK for WeChat mini programs