Skip to main content

Module media

Module media 

Source
Expand description

Media upload and download support.

§Upload

Use Client::upload_file to upload a file from a byte buffer or Client::upload_stream for streamed uploads. The returned UploadedFile can be passed to Client::send_file or Client::send_album.

§Download

Use Client::download_media to collect all bytes of a media attachment, or Client::iter_download for chunk-by-chunk streaming.

Structs§

DownloadIter
Iterator that downloads a media file chunk by chunk.
UploadedFile
A successfully uploaded file, ready to be sent as media.

Constants§

DOWNLOAD_CHUNK_SIZE
Maximum chunk size for file downloads (512 KB).
UPLOAD_CHUNK_SIZE
Maximum chunk size for file uploads (512 KB).