Tüm Ürünler
Search
Belge Merkezi

ApsaraVideo VOD:C/C++ için yükleme SDK'sını kullanın

Son Güncelleme:Oct 05, 2026

Bu konu, medya dosyalarını ApsaraVideo VOD'a yüklemek için C veya C++ sunucu yükleme SDK'sının nasıl kullanılacağını açıklar.

Yükleme süreci

C veya C++ için yükleme SDK'sı, ApsaraVideo VOD SDK'larının genel sürecini izler. Daha fazla bilgi için bkz. Yükleme süreci. Aşağıdaki içerik, C veya C++ sunucu yükleme SDK'sını kullanmanın temel sürecini açıklar:

  1. Ön koşullar bölümünde açıklandığı gibi yapılandırmaları tamamlayın.

  2. C veya C++ sunucu yükleme SDK'sını entegre edin. Daha fazla bilgi için bkz. C veya C++ sunucu yükleme SDK'sını entegre etme.

  3. Yükleme mantığını uygulamak üzere yükleme bilgilerini yapılandırın.

Ön koşullar

  • ApsaraVideo VOD etkinleştirilmiştir. Daha fazla bilgi için bkz. ApsaraVideo VOD'u etkinleştirme.

  • Belirtilen bölgedeki depolama yolu ve geri arama ayarları dahil olmak üzere yükleme için gereken sistem ayarları yapılandırılmıştır. Daha fazla bilgi için bkz. Depolama paketlerini yönetme ve Geri aramaları yapılandırma.

  • ApsaraVideo VOD'a erişmek için bir RAM kullanıcısı oluşturulmuştur. Alibaba Cloud hesabınızın AccessKey çiftinin sızmasından kaynaklanan güvenlik risklerini önlemek için bir RAM kullanıcısı oluşturmanızı ve bu kullanıcıya ApsaraVideo VOD'a erişim için gerekli izinleri vermenizi öneririz. Ardından, ApsaraVideo VOD'a erişmek için RAM kullanıcısının AccessKey çiftini kullanabilirsiniz. Daha fazla bilgi için bkz. RAM kullanıcısı oluşturma ve izin verme.

  • ALIBABA_CLOUD_ACCESS_KEY_ID ve ALIBABA_CLOUD_ACCESS_KEY_SECRET ortam değişkenlerini yapılandırın. Daha fazla bilgi için bkz. Linux, macOS ve Windows'ta ortam değişkenlerini yapılandırma.

    Önemli
    • Bir Alibaba Cloud hesabı AccessKey çifti, tüm API işlemleri üzerinde izinlere sahiptir. API işlemlerini çağırmak veya rutin işletim ve bakım yapmak için bir RAM kullanıcısının AccessKey çiftini kullanın.

    • AccessKey ID'nizi ve AccessKey gizli anahtarınızı proje koduna sabit olarak kodlamayın. Sızması durumunda, hesabınızdaki tüm kaynaklar tehlikeye girer.

  • İsteğe bağlı. ApsaraVideo VOD'a Security Token Service (STS) kullanarak erişmek istiyorsanız, RAM kullanıcısı için bir rol oluşturulmuş ve bu role ApsaraVideo VOD'a erişim için gerekli izinler verilmiştir. Daha fazla bilgi için bkz. STS belirteci alma.

C veya C++ sunucu yükleme SDK'sını entegre etme

Not
  • C veya C++ sunucu yükleme SDK'sı yalnızca Linux işletim sistemine kurulabilir.

  • Bu örnekte SDK V1.0.0 kullanılmaktadır. İş gereksinimlerinize göre diğer sürümleri kullanabilirsiniz.

  • C veya C++ sunucu yükleme SDK'sının dizinleri ve örnek kod hakkında daha fazla bilgi için bkz. Dizinler.

  • Bu konu, C veya C++ sunucu yükleme SDK'sının kök olmayan bir kullanıcı olarak nasıl kurulacağını açıklar ve kurulum komutlarına örnekler sunar.

Aşağıdaki tabloda gerekli yazılım paketleri, kullanımları ve kurulum örnekleri açıklanmaktadır.

Yazılım paketi

Açıklama

YUM ile kurulum

İnternet üzerinden indirilen paketlerle kurulum

CMake

Üçüncü taraf derleyici.

  • Sürüm: V2.6.0 veya üzeri

  • Örnek kod:

    sudo yum install cmake
  • İndirme bağlantısı: CMake

  • Örnek kod:

    ./configure
        make
        make install

libcurl

Ağ bağlantısı sorunlarını giderir.

  • Sürüm: V7.29.0 veya üzeri

  • Örnek kod:

    sudo yum install libcurl-devel
  • İndirme bağlantısı: libcurl

  • Örnek kod:

    ./configure
        make
        make install

libuuid

UUID'ler oluşturur.

Örnek kod:

sudo yum install libuuid-devel

Yok

apr

Yok

Örnek kod:

sudo yum install apr-devel
  • İndirme bağlantısı: apr

  • Örnek kod:

    ./configure
        make
        make install

apr-util

Bellek kullanımını ve çapraz platform sorunlarını yönetir.

Örnek kod:

sudo yum install apr-util
  • İndirme bağlantısı: apr-util

  • Örnek kod:

    // Paketi yüklerken with-apr parametresini belirtin. 
        ./configure --with-apr=/your/apr/install/path
        make
        make install

minixml

XML formatında döndürülen verileri ayrıştırır.

Örnek kod:

sudo yum install mxml mxml-devel
  • İndirme bağlantısı: minixml

  • Örnek kod:

    ./configure
        make
        make install

jsoncpp

JSON formatında döndürülen verileri ayrıştırır.

Örnek kod:

sudo yum install jsoncpp-devel
  • İndirme bağlantısı: jsoncpp

  • Örnek kod:

    ./configure
        make
        make install

OSS SDK

C veya C++ sunucu yükleme SDK'sını kullanmadan önce, C veya C++ için Object Storage Service (OSS) SDK'sını indirmeniz ve kurmanız gerekir.

Yok

İndirme bağlantısı ve kurulum yordamı hakkında daha fazla bilgi için bkz. Kurulum (C SDK).

Önemli

Bazı OSS bağımlılıkları zaten kurulduysa, bunları tekrar kurmanıza gerek yoktur.

C veya C++ için Yükleme SDK'sı

Medya dosyalarını yükler.

Yok

  • Örnek kod:

cmake .
make
make install

Dizinler

/VodSDK-C_1.0.0.gz/VodSDK-C_1.0.0/aliyun-c-sdk-vod/src/upload.h

Dizin

Açıklama

CreateUploadVideoRequest

Video yükleme isteği sınıfı. Parametreler hakkında daha fazla bilgi için bkz. CreateUploadVideo.

CreateUploadImageRequest

Görsel yükleme isteği sınıfı. Parametreler hakkında daha fazla bilgi için bkz. CreateUploadImage.

CreateUploadAttachedMediaRequest

Ek medya varlıklarının yüklenmesi için istek sınıfı. Parametreler hakkında daha fazla bilgi için bkz. CreateUploadAttachedMedia.

UploadOptions

Yükleme parametresi yapısı. Aşağıdaki öğeler parametreleri açıklar.

  • void (*uploadProgressCallback) (int64_t, int64_t): yükleme ilerlemesi için bir geri arama işlevi yapılandırır. Bu parametreyi ayarlamazsanız varsayılan geri arama yapılandırmaları kullanılır. Bu parametreyi NULL olarak ayarlarsanız, yükleme ilerlemesi için herhangi bir geri arama çağrılmaz.

  • ecsRegionId: yükleme betiğinin dağıtıldığı ECS örneğinin bölgesini belirtir. ECS bölgesi, ApsaraVideo VOD'un depolama bölgesiyle aynıysa dosya otomatik olarak dahili ağ üzerinden yüklenir.

  • multipartUploadLimit: çok parçalı yükleme için dosya boyutu sınırını belirtir. Birim: bayt. Varsayılan değer: 10 MB. Bu parametre yalnızca video yüklemeleri için geçerlidir.

  • multipartUploadOnceSize: çok parçalı yüklemede her bir parçanın boyutunu belirtir. Birim: bayt. Varsayılan değer: 10 MB. Bu parametre yalnızca video yüklemeleri için geçerlidir.

  • tmpDir: dosyaları geçici olarak depolamak için yerel bir dizin belirtir. Bu parametre yalnızca çevrimiçi dosyaların yüklenmesi için geçerlidir.

uploadLocalVideo

Yerel videoları yüklemek için kullanılan API işlemi.

uploadWebVideo

Çevrimiçi videoları yüklemek için kullanılan API işlemi.

uploadLocalImage

Yerel görselleri yüklemek için kullanılan API işlemi.

uploadWebImage

Çevrimiçi görselleri yüklemek için kullanılan API işlemi.

uploadLocalAttachedMedia

Yerel ek medya varlıklarını yüklemek için kullanılan API işlemi.

uploadWebAttachedMedia

Çevrimiçi ek medya varlıklarını yüklemek için kullanılan API işlemi.

uploadLocalM3u8

Yerel M3U8 videolarını yüklemek için kullanılan API işlemi.

uploadWebM3u8

Çevrimiçi M3U8 videolarını yüklemek için kullanılan API işlemi.

/VodSDK-C_1.0.0.gz/VodSDK-C_1.0.0/aliyun-c-sdk-vod/samples


Dizin


Açıklama


uploadVideo.cpp


Videoları yüklemek için örnek kod.


uploadImage.cpp


Görselleri yüklemek için örnek kod.


uploadAttachedMedia.cpp


Ek medya varlıklarını yüklemek için örnek kod.

Senaryo 1: Ses ve video dosyalarını yükleme

Normal ses ve video dosyaları

ApsaraVideo VOD, ses veya video dosyalarını aşağıdaki yöntemlerden birini kullanarak yüklemenize olanak tanır:

  • Yerel bir dosyayı yüklemek için çok parçalı yüklemeyi kullanın. Boyutu 48,8 TB'a kadar olan bir dosyayı yükleyebilirsiniz. Kaldığı yerden devam eden yükleme desteklenmez. Daha fazla bilgi için örnek koddaki testUploadLocalVideo işlevine bakın.

  • Çevrimiçi bir dosyayı yüklemek için dosya URL'sini kullanın. Boyutu 48,8 TB'a kadar olan bir dosyayı yükleyebilirsiniz. Çevrimiçi dosyaları yüklemeden önce, dosyaları yerel diske indirmeniz gerekir. Yerel diskte yeterli alan olduğundan emin olun. Daha fazla bilgi için aşağıdaki örnek koddaki testUploadWebVideo işlevine bakın.

Örnek kodu göster

void testCallback(int64_t consumed_bytes, int64_t total_bytes)
{
    printf("total :%ld, %ld\n", consumed_bytes, total_bytes);
}
// Test the upload of a local video.
VodApiResponse testUploadLocalVideo(VodCredential authInfo) {
    CreateUploadVideoRequest request;
    // The name of the source file.
    request.fileName = "test.mp4";
    // The title of the video.
    request.title = "testVideo****";
    // The category ID of the video.
    request.cateId = "1";
    // The URL of the custom video thumbnail. Example: http://example.com/example-****.jpg.
    request.coverURL = "<your cover URL>";
    // The tags of the video.
    request.tags = "test1,test2";
    // The ID of the transcoding template group.
    request.templateGroupId = "6ae347b0140181ad371d197ebe28****";
    // The storage address. Example: example-bucket-****.oss-cn-shanghai.aliyuncs.com.
    requests.storageLocation = "<your torageLocation>";
    Json::Value userData;
    Json::Value callbackUrl;
    // The callback URL. Example: https://example.aliyundoc.com/ProcessMessageCallback.
    callbackUrl["CallbackURL"] = "<your callback URL>";
    userData["MessageCallback"] = callbackUrl;
    Json::Value extend;
    extend["localId"] = "xxx";
    extend["test"] = "www";
    userData["Extend"] = extend;
    request.userData = userData.toStyledString();
    UploadOptions uploadOptions;
    // Specify the region of the ECS instance where the upload script is deployed. If the ECS region is the same as the storage region of ApsaraVideo VOD, the file is automatically uploaded over the internal network.
    //uploadOptions.ecsRegionId = "cn-shanghai";
    // Configure a callback function for the upload progress. If you do not set this parameter, the default callback configurations are used. If you set this parameter to NULL, no callback for the upload progress is invoked.
    //uploadOptions.uploadProgressCallback = testCallback;
    //uploadOptions.multipartUploadLimit = 20*1024*1024;// Specify the file size limit for multipart upload.
    //uploadOptions.multipartUploadOnceSize = 10*1024*1024;// Specify the size of each part in multipart upload.
    VodApiResponse result = uploadLocalVideo(authInfo, request, "./test.mp4", uploadOptions);
    return result;
}
// Test the upload of an online video.
VodApiResponse testUploadWebVideo(VodCredential authInfo) {
    CreateUploadVideoRequest request;
    request.fileName = "testWeb****.mp4";
    request.title = "testUploadWebVideo****";
    UploadOptions uploadOptions;
    // Specify the region of the ECS instance where the upload script is deployed. If the ECS region is the same as the storage region of ApsaraVideo VOD, the file is automatically uploaded over the internal network.
    //uploadOptions.ecsRegionId = "cn-shanghai";
    // Configure a callback function for the upload progress. If you do not set this parameter, the default callback configurations are used. If you set this parameter to NULL, no callback for the upload progress is invoked.
    //uploadOptions.uploadProgressCallback = testCallback;
    //uploadOptions.multipartUploadLimit = 20*1024*1024;// Specify the file size limit for multipart upload.
    //uploadOptions.multipartUploadOnceSize = 10*1024*1024;// Specify the size of each part in multipart upload.
    // Specify a local directory to temporarily store the downloaded online files. Default value: /tmp/.
    //uploadOptions.tmpDir = "/tmp/";
    VodApiResponse result = uploadWebVideo(authInfo, request, "<Your Download Url>", uploadOptions);
    return result;
}

####  Run the test code.   ####
VodCredential initVodClient(std::string accessKeyId, std::string accessKeySecret) {
    VodCredential authInfo;
    authInfo.accessKeyId = accessKeyId;
    authInfo.accessKeySecret = accessKeySecret;
    authInfo.regionId = "cn-shanghai";
    return authInfo;
}
int main(int argc, char * argv[]) {
    // The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. We recommend that you use a RAM user to call API operations or perform routine O&M. 
    // We recommend that you not include your AccessKey pair (AccessKey ID and AccessKey secret) in your project code. Otherwise, the AccessKey pair may be leaked and the security of all resources within your account may be compromised. 
    // In this example, ApsaraVideo VOD reads the AccessKey pair from the environment variables to implement identity verification for API access. Before you run the sample code, configure the environment variables ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET. 
    VodCredential authInfo = initVodClient(std:getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"), std:getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"));
    VodApiResponse response;
    response = testUploadLocalVideo(authInfo);
    //response = testUploadWebVideo(authInfo);
    //response = testUploadLocalM3u8(authInfo);
    //response = testUploadWebM3u8(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

M3U8 dosyaları

Örnek kodu göster

void testCallback(int64_t consumed_bytes, int64_t total_bytes)
{
    printf("total :%ld, %ld\n", consumed_bytes, total_bytes);
}
// Test the upload of a local M3U8 video.
VodApiResponse testUploadLocalM3u8(VodCredential authInfo) {
    CreateUploadVideoRequest request;
    // The name of the source file.
    request.fileName = "testLocal****.m3u8";
    // The title of the video.
    request.title = "testUploadLocalM3u8****";
    list<string> tsList;
    // If you do not specify the URLs of part files, the files are automatically parsed.
    //tsList.push_back("/tmp/1.ts");
    UploadOptions uploadOptions;
    VodApiResponse result = uploadLocalM3u8(authInfo, request, "./test****.m3u8", tsList, uploadOptions);
    return result;
}
// Test the upload of an online M3U8 video.
VodApiResponse testUploadWebM3u8(VodCredential authInfo) {
    CreateUploadVideoRequest request;
    // The name of the source file.
    request.fileName = "testWeb****.m3u8";
    // The title of the video.
    request.title = "testUploadWebM3u8****";
    list<string> tsList;
    // If you do not specify the URLs of part files, the files are automatically parsed.
    //tsList.push_back("<Ts1 Download Url>");
    //tsList.push_back("<Ts2 Download Url>");
    UploadOptions uploadOptions;
    VodApiResponse result = uploadWebM3u8(authInfo, request, "<Your M3u8 Download Url>", tsList, uploadOptions);
    return result;
}
####  Run the test code.   ####
VodCredential initVodClient(std::string accessKeyId, std::string accessKeySecret) {
    VodCredential authInfo;
    authInfo.accessKeyId = accessKeyId;
    authInfo.accessKeySecret = accessKeySecret;
    authInfo.regionId = "cn-shanghai";
    return authInfo;
}
int main(int argc, char * argv[]) {
    // The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. We recommend that you use a RAM user to call API operations or perform routine O&M. 
    // We recommend that you not include your AccessKey pair (AccessKey ID and AccessKey secret) in your project code. Otherwise, the AccessKey pair may be leaked and the security of all resources within your account may be compromised. 
    // In this example, ApsaraVideo VOD reads the AccessKey pair from the environment variables to implement identity verification for API access. Before you run the sample code, configure the environment variables ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET. 
    VodCredential authInfo = initVodClient(std:getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"), std:getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"));
    VodApiResponse response;
    response = testUploadLocalVideo(authInfo);
    //response = testUploadWebVideo(authInfo);
    //response = testUploadLocalM3u8(authInfo);
    //response = testUploadWebM3u8(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

Senaryo 2: Görselleri yükleme

Örnek kodu göster

void testCallback(int64_t consumed_bytes, int64_t total_bytes)
{
    printf("total :%ld, %ld\n", consumed_bytes, total_bytes);
}

VodApiResponse testUploadLocalImage(VodCredential authInfo)
{
    CreateUploadImageRequest request;
    // The type of the image.
    request.imageType = "default";
    // The title of the image.
    request.title = "testUploadLocalImage";
    UploadOptions uploadOptions;
    // Specify the region of the ECS instance where the upload script is deployed. If the ECS region is the same as the storage region of ApsaraVideo VOD, the file is automatically uploaded over the internal network.
    //uploadOptions.ecsRegionId = "cn-shanghai";
    // Configure a callback function for the upload progress. If you do not set this parameter, the default callback configurations are used. If you set this parameter to NULL, no callback for the upload progress is invoked.
    //uploadOptions.uploadProgressCallback = testCallback;
    VodApiResponse result = uploadLocalImage(authInfo, request, "./test.png", uploadOptions);
    return result;
}

VodApiResponse testUploadWebImage(VodCredential authInfo) {
    CreateUploadImageRequest request;
    request.imageType = "default";
    request.title = "testUploadWebImage";
    UploadOptions uploadOptions;
    // Specify the region of the ECS instance where the upload script is deployed. If the ECS region is the same as the storage region of ApsaraVideo VOD, the file is automatically uploaded over the internal network.
    //uploadOptions.ecsRegionId = "cn-shanghai";
    // Configure a callback function for the upload progress. If you do not set this parameter, the default callback configurations are used. If you set this parameter to NULL, no callback for the upload progress is invoked.
    //uploadOptions.uploadProgressCallback = testCallback;
    // Specify a local directory to temporarily store the downloaded online files. Default value: /tmp/.
    //uploadOptions.tmpDir = "/tmp/";
    VodApiResponse result = uploadWebImage(authInfo, request, "<Your Download Url>", uploadOptions);
    return result;
}

VodCredential initVodClient(std::string accessKeyId, std::string accessKeySecret) {
    VodCredential authInfo;
    authInfo.accessKeyId = accessKeyId;
    authInfo.accessKeySecret = accessKeySecret;
    authInfo.regionId = "cn-shanghai";
    return authInfo;
}

Örnek kodu göster

int main(int argc, char * argv[]) {
    // The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. We recommend that you use a RAM user to call API operations or perform routine O&M. 
    // We recommend that you not include your AccessKey pair (AccessKey ID and AccessKey secret) in your project code. Otherwise, the AccessKey pair may be leaked and the security of all resources within your account may be compromised. 
    // In this example, ApsaraVideo VOD reads the AccessKey pair from the environment variables to implement identity verification for API access. Before you run the sample code, configure the environment variables ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET. 
    VodCredential authInfo = initVodClient(std:getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"), std:getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"));
    VodApiResponse response;

    response = testUploadLocalImage(authInfo);
    //response = testUploadWebImage(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

Senaryo 3: Ek medya varlıklarını yükleme

Örnek kodu göster

void testCallback(int64_t consumed_bytes, int64_t total_bytes)
{
    printf("total :%ld, %ld\n", consumed_bytes, total_bytes);
}

VodApiResponse testUploadLocalAttachedMedia(VodCredential authInfo)
{
    CreateUploadAttachedMediaRequest request;
    // The type of the auxiliary media asset.
    request.businessType = "watermark";'
    // The file name extension.
    request.mediaExt = "png";
    // The title of the auxiliary media asset.
    request.title = "testUploadLocalAttachedMedia";
    UploadOptions uploadOptions;
    // Specify the region of the ECS instance where the upload script is deployed. If the ECS region is the same as the storage region of ApsaraVideo VOD, the file is automatically uploaded over the internal network.
    //uploadOptions.ecsRegionId = "cn-shanghai";
    // Configure a callback function for the upload progress. If you do not set this parameter, the default callback configurations are used. If you set this parameter to NULL, no callback for the upload progress is invoked.
    //uploadOptions.uploadProgressCallback = testCallback;
    return uploadLocalAttachedMedia(authInfo, request, "./test.png", uploadOptions);
}

VodApiResponse testUploadWebAttachedMedia(VodCredential authInfo)
{
    CreateUploadAttachedMediaRequest request;
    // The type of the auxiliary media asset.
    request.businessType = "watermark";
    // The file name extension.
    request.mediaExt = "png";
    // The title of the auxiliary media asset.
    request.title = "testUploadWebAttachedMedia";
    UploadOptions uploadOptions;
    // Specify the region of the ECS instance where the upload script is deployed. If the ECS region is the same as the storage region of ApsaraVideo VOD, the file is automatically uploaded over the internal network.
    //uploadOptions.ecsRegionId = "cn-shanghai";
    // Configure a callback function for the upload progress. If you do not set this parameter, the default callback configurations are used. If you set this parameter to NULL, no callback for the upload progress is invoked.
    //uploadOptions.uploadProgressCallback = testCallback;
    // Specify a local directory to temporarily store the downloaded online files. Default value: /tmp/.
    //uploadOptions.tmpDir = "/tmp/";
    return uploadWebAttachedMedia(authInfo, request, "<Your Download Url>", uploadOptions);
}

VodCredential initVodClient(std::string accessKeyId, std::string accessKeySecret) {
    VodCredential authInfo;
    authInfo.accessKeyId = accessKeyId;
    authInfo.accessKeySecret = accessKeySecret;
    authInfo.regionId = "cn-shanghai";
    return authInfo;
}

Örnek kodu göster

int main(int argc, char * argv[]) {
    // The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. We recommend that you use a RAM user to call API operations or perform routine O&M. 
    // We recommend that you not include your AccessKey pair (AccessKey ID and AccessKey secret) in your project code. Otherwise, the AccessKey pair may be leaked and the security of all resources within your account may be compromised. 
    // In this example, ApsaraVideo VOD reads the AccessKey pair from the environment variables to implement identity verification for API access. Before you run the sample code, configure the environment variables ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET. 
    VodCredential authInfo = initVodClient(std:getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"), std:getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"));
    VodApiResponse response;
    response = testUploadLocalAttachedMedia(authInfo);
    //response = testUploadWebAttachedMedia(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}