Загрузить фрагмент файла
Позволяет загрузить файл по частям. Перед началом загрузки нужно создать сессию: Создать сессию загрузки файла.
- Используется тип
Content-Type: application/octet-stream - Файл может быть разделен на части размером от 5 МБ до 16 МБ (кроме последней части). Части передаются в теле запроса.
- Для первой части файла нужно указать параметр
part_number=1, для каждой следующей частиpart_numberувеличивается на единицу. - Части можно грузить параллельно и перезагружать при ошибке.
Request
PUT
https://api.wiki.yandex.net/v1/upload_sessions/{session_id}/upload_part
Path parameters
|
Name |
Description |
|
session_id |
Type: string<uuid4> Example: `` |
Query parameters
|
Name |
Description |
|
part_number |
Type: integer Min value: Max value: |
Responses
200 OK
OK
Body
application/json
{
"session_id": "example",
"file_name": "example",
"file_size": 0,
"status": "not_started",
"user": {
"id": 0,
"identity": {
"uid": "example",
"cloud_uid": "example"
},
"username": "example",
"display_name": "example",
"is_dismissed": true,
"affiliation": "example"
},
"created_at": "2025-01-01T00:00:00Z",
"finished_at": "2025-01-01T00:00:00Z",
"storage_type": "mds"
}
|
Name |
Description |
|
created_at |
Type: string<date-time> Example: |
|
file_name |
Type: string Example: |
|
file_size |
Type: integer |
|
session_id |
Type: string<uuid4> Example: |
|
status |
Type: UploadSessionStatusType An enumeration. Enum: |
|
user |
Type: UserSchema Информация о пользователе Example
|
|
finished_at |
Type: string<date-time> Example: |
|
storage_type |
Type: StorageType An enumeration. Enum: |
UploadSessionStatusType
An enumeration.
Type: string
Enum: not_started, in_progress, finished, aborted, used, cleanup
UserIdentity
Идентификатор пользователя
|
Name |
Description |
|
cloud_uid |
Type: string Идентификатор пользователя в облаке (для внешнего инстанса) Example: |
|
uid |
Type: string Идентификатор пользователя в Яндекс (для внутреннего инстанса) Example: |
Example
{
"uid": "example",
"cloud_uid": "example"
}
UserSchema
Информация о пользователе
|
Name |
Description |
|
affiliation |
Type: string Принадлежность пользователя (например, Example: |
|
display_name |
Type: string Отображаемое имя пользователя Example: |
|
id |
Type: integer Внутренний идентификатор пользователя |
|
is_dismissed |
Type: boolean Пользователь уволен |
|
username |
Type: string Логин пользователя Example: |
|
identity |
All of 1 type
Идентификатор пользователя в системе Example
|
Example
{
"id": 0,
"identity": {
"uid": "example",
"cloud_uid": "example"
},
"username": "example",
"display_name": "example",
"is_dismissed": true,
"affiliation": "example"
}
StorageType
An enumeration.
Type: string
Enum: mds, s3, custom_s3