SaveFilePartRequest

Both users and bots can use this request. See code examples.

---functions---
upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool

Returns

Bool

This type has no instances available.

Parameters

file_idlong
file_partint
bytesbytes

Known RPC errors

This request can cause 4 known errors:

FilePartEmptyErrorThe provided file part is empty.
FilePartInvalidErrorThe file part number is invalid.
InputFetchFailErrorFailed deserializing TL payload.
SessionPasswordNeededErrorTwo-steps verification is enabled and a password is required.

You can import these from telethon.errors.

Example

Please refer to the documentation of client.upload_file() to learn about the parameters and see several code examples on how to use it.

The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.upload.SaveFilePartRequest(
        file_id=-12398745604826,
        file_part=42,
        bytes=b'arbitrary\x7f data \xfa here'
    ))
    print(result)