uploadAppend

fun Media.uploadAppend(    media: MediaComponent,     mediaId: Long,     segmentIndex: Int,     mediaKey: String? = null,     vararg options: Option): EmptyApiAction

The APPEND command is used to upload a chunk (consecutive byte range) of the media file. For example, a 3 MB file could be split into 3 chunks of size 1 MB, and uploaded using 3 APPEND command requests. After the entire file is uploaded, the next step is to call the FINALIZE command. There are a number of advantages of uploading a media file in small chunks:

  • Improved reliability and success rates under low bandwidth network conditions

  • Uploads can be paused and resumed

  • File chunks can be retried individually

  • Ability to tune chunk sizes to match changing network conditions e.g on cellular clients

Twitter API reference

Receiver

Media endpoint instance.

Return

EmptyApiAction.

Parameters

mediaId

The media_id returned from the INIT command.

segmentIndex

An ordered index of file chunk. It must be between 0-999 inclusive. The first segment has index 0, second segment has index 1, and so on.

options

Optional. Custom parameters of this request.