save_file()

async Client.save_file()

Upload a file onto Telegram servers, without sending the message to anyone.

Useful whenever an InputFile type is required for raw API functions.

Usable by Users Bots
Parameters:
  • path (str | BinaryIO) – File path or binary file-like object.

  • file_id (int, optional) – File ID to resume an interrupted upload.

  • file_part (int, optional) – Part number to resume from.

  • progress (Callable, optional) – Callback — takes (current, total) as positional arguments.

  • progress_args (tuple, optional) – Extra arguments for the progress callback.

Returns:

InputFile | InputFileBig – On success.

Raises:

RPCError – In case of a Telegram RPC error.