An external web document, that is not stored on Telegram severs, and is available by a HTTP(s) url.

Note: not all web documents are downloadable through Telegram. Media files usually are, and web pages (i.e. mimeType = text/html) usually aren't. To be sure, check isDownloadable property.

Hierarchy (View Summary)

Constructors

Properties

dcId?: number

DC ID of the file, when available

fileSize?: number

File size in bytes, when available

location:
    | Uint8Array
    | TypeInputFileLocation
    | TypeInputWebFileLocation
    | () => Uint8Array | TypeInputFileLocation | TypeInputWebFileLocation

Location of the file.

Either a TL object declaring remote file location, a Buffer containing actual file content (for stripped thumbnails and vector previews), or a function that will return either of those.

When a function is passed, it will be lazily resolved the first time downloading the file.

Accessors

  • get isDownloadable(): boolean
  • Whether this file can be downloaded through Telegram.

    If false, you should use url to manually fetch data via HTTP(s), and trying to use download* methods will result in an error

    Returns boolean

  • get mimeType(): string
  • MIME type of the file

    Returns string

  • get url(): string
  • URL to the file

    Returns string