Mengembalikan URL unggah dan unggah kredensial untuk memastikan otorisasi dan keamanan, mencegah unggahan berbahaya, dan secara otomatis membuat ID image untuk manajemen. Mengambil URL unggah dan unggah kredensial untuk mengunggah file image serta menghasilkan ID image.
Deskripsi operasi
Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see Billing of media asset storage. If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see Billing of acceleration traffic.
You must obtain a URL and a credential before you upload an image to ApsaraVideo VOD. ApsaraVideo VOD provides multiple upload methods. You can upload files by using server upload SDKs, client upload SDKs, URLs, Object Storage Service (OSS) API, or OSS SDKs. Each upload method has different requirements for obtaining upload URLs and credentials. For more information, see the "Usage notes" section of the Upload URLs and credentials topic.
You cannot refresh the upload URL or credential when you upload images. If the image upload credential expires, you can call this operation to obtain a new upload URL and credential. By default, the validity period of an image upload credential is 3,000 seconds.
You can call the CreateUploadAttachedMedia operation to upload image watermarks.
You can configure a callback for ImageUploadComplete to receive notifications about the image upload status.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vod:CreateUploadImage |
create |
*All Resource
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Title |
string |
No |
Judul image. Aturan berikut berlaku:
|
mytitle |
| ImageType |
string |
Yes |
Tipe image. Nilai valid:
Catatan
Anda hanya dapat mengelola image bertipe default di konsol ApsaraVideo VOD. |
default |
| ImageExt |
string |
No |
Ekstensi nama file image. Nilai valid:
|
png |
| OriginalFileName |
string |
No |
Nama file sumber. Catatan
Nama harus mengandung ekstensi nama file. Ekstensi nama file tidak peka huruf besar-kecil. |
D:\picture_01.png |
| Tags |
string |
No |
Tag image. Aturan berikut berlaku:
|
test |
| StorageLocation |
string |
No |
Alamat penyimpanan. Lakukan operasi berikut untuk mendapatkan alamat penyimpanan: Masuk ke Konsol ApsaraVideo VOD. Di panel navigasi sebelah kiri, pilih Configuration Management > Manajemen media > Storage. Di halaman Storage, lihat alamat penyimpanan. Catatan
Jika Anda menentukan alamat penyimpanan, file media akan diunggah ke alamat yang ditentukan. |
outin-****..oss-cn-shanghai.aliyuncs.com |
| CateId |
integer |
No |
ID kategori image. Anda dapat menggunakan salah satu metode berikut untuk mendapatkan ID kategori:
|
100036**** |
| UserData |
string |
No |
Konfigurasi kustom, termasuk konfigurasi callback dan konfigurasi akselerasi unggah. Nilai harus berupa string JSON. Untuk informasi lebih lanjut, lihat bagian "UserData: specifies the custom configurations for media upload" pada topik Parameter permintaan. Catatan
|
{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}} |
| Description |
string |
No |
Deskripsi image.
|
The description of the image |
| AppId |
string |
No |
ID aplikasi. Nilai default: app-1000000. Untuk informasi lebih lanjut, lihat Ikhtisar. |
app-1000000 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The returned result. |
||
| FileURL |
string |
The OSS URL of the file. The URL does not contain the information used for URL signing. You can specify FileUrl when you call the AddWatermark operation. |
http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png |
| RequestId |
string |
The ID of the request. |
25818875-5F78-AEF6-D7393642**** |
| UploadAddress |
string |
The upload URL. Catatan
The returned upload URL is a Base64-encoded URL. You must decode the Base64-encoded URL before you use an SDK or call an API operation to upload auxiliary media assets. You need to parse UploadAddress only if you use the OSS SDK or call an OSS API operation to upload auxiliary media assets. |
eyJTZWN1cmuIjoiQ0FJU3p3TjF**** |
| ImageURL |
string |
The URL of the image. Catatan
If the returned URL is inaccessible from a browser and the HTTP 403 status code is returned, the URL signing feature in ApsaraVideo VOD is enabled. To resolve this issue, you can disable the URL signing feature or generate a signed URL. |
http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png |
| ImageId |
string |
The ID of the image file. |
93ab850b4f6f46e91d24d81d4**** |
| UploadAuth |
string |
The upload credential. Catatan
The returned upload credential is a Base64-encoded value. You must decode the Base64-encoded credential before you use an SDK or call an API operation to upload auxiliary media assets. You need to parse UploadAuth only if you use the OSS SDK or call an OSS API operation to upload auxiliary media assets. |
eyJFbmmRCI6Im**** |
Contoh
Respons sukses
JSONformat
{
"FileURL": "http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png",
"RequestId": "25818875-5F78-AEF6-D7393642****",
"UploadAddress": "eyJTZWN1cmuIjoiQ0FJU3p3TjF****",
"ImageURL": "http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png",
"ImageId": "93ab850b4f6f46e91d24d81d4****",
"UploadAuth": "eyJFbmmRCI6Im****"
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.