upload.getWebfile

Returns content of an HTTP file or a part, by proxying the request through telegram.

Example

const {Api, TelegramClient} = require('telegram');
const {StringSession} = require('telegram/sessions');

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result = await client.invoke(new Api.upload.getWebfile({
        location: new Api.InputWebFileLocation({...}),
        offset: 9204221,
        limit: 6983700,
        }));
    console.log(result); // prints the result
})();

TL schema

upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;
---functions---
upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;

Parameters

Name

Type

Description

location

The file to download

offset

Number of bytes to be skipped

limit

Number of bytes to be returned

Result

upload.WebFilearrow-up-right

Possible errors

Code

Type

Description

400

LOCATION_INVALID

The provided location is invalid

Can bots use this methd ?

yes

Last updated