UrlInputFile
extends InputFile
in package
FinalYes
Standalone abstract — InputFile is intentionally NOT a TelegramObject. Upstream aiogram declares `class InputFile(ABC)` (aiogram/types/input_file.py); attaching it to the TelegramObject tree would make it eligible for Serializer dump/load, which is wrong: InputFile values are detached by `BaseSession::prepareValue` into the multipart `$files` channel and never go through JSON.
Table of Contents
Constants
- DEFAULT_CHUNK_SIZE : int = 65536
Properties
- $chunkSize : int
- $defaultBot : Bot|null
- Optional fallback bot — used by Phase 6 streaming when read() is called without an explicit bot.
- $filename : string|null
- $headers : null|array<string, string>
- $timeout : int
- $url : string
Methods
- __construct() : mixed
- read() : ReadableStream
- Returns a Fiber-aware readable stream of file bytes.
Constants
DEFAULT_CHUNK_SIZE
public
int
DEFAULT_CHUNK_SIZE
= 65536
Properties
$chunkSize read-only
public
int
$chunkSize
= self::DEFAULT_CHUNK_SIZE
$defaultBot read-only
Optional fallback bot — used by Phase 6 streaming when read() is called without an explicit bot.
public
Bot|null
$defaultBot
= null
$filename read-only
public
string|null
$filename
= null
$headers read-only
public
null|array<string, string>
$headers
= null
$timeout read-only
public
int
$timeout
= 30
$url read-only
public
string
$url
Methods
__construct()
public
__construct(string $url[, array<string|int, mixed>|null $headers = null ][, string|null $filename = null ][, int $chunkSize = self::DEFAULT_CHUNK_SIZE ][, int $timeout = 30 ][, Bot|null $defaultBot = null ]) : mixed
Parameters
- $url : string
- $headers : array<string|int, mixed>|null = null
- $filename : string|null = null
- $chunkSize : int = self::DEFAULT_CHUNK_SIZE
- $timeout : int = 30
- $defaultBot : Bot|null = null
read()
Returns a Fiber-aware readable stream of file bytes.
public
read(Bot $bot) : ReadableStream
Parameters
- $bot : Bot