class File

This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot/. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.

Methods

__construct(string $file_id, string $file_unique_id, int|null $file_size = null, string|null $file_path = null)

No description

string
getFileId()

Identifier for this file, which can be used to download or reuse the file.

string
getFileUniqueId()

Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.

int|null
getFileSize()

Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

string|null
getFilePath()

Optional. File path. Use https://api.telegram.org/file/bot/ to get the file.

Details

at line 16
__construct(string $file_id, string $file_unique_id, int|null $file_size = null, string|null $file_path = null)

No description

Parameters

string $file_id
string $file_unique_id
int|null $file_size
string|null $file_path

at line 27
string getFileId()

Identifier for this file, which can be used to download or reuse the file.

Return Value

string

at line 35
string getFileUniqueId()

Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.

Return Value

string

at line 43
int|null getFileSize()

Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

Return Value

int|null

at line 51
string|null getFilePath()

Optional. File path. Use https://api.telegram.org/file/bot/ to get the file.

Return Value

string|null