Returns content of a web file, by proxying the request through telegram, see the webfile docs for more info.

Note: the query must be sent to the DC specified in the webfile_dc_id MTProto configuration field.

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


Name Type Description
location InputWebFileLocation The file to download
offset int Number of bytes to be skipped
limit int Number of bytes to be returned



Possible errors

Code Type Description
400 DOCUMENT_INVALID The specified document is invalid.
400 LOCATION_INVALID The provided location is invalid.

Related pages

Uploading and Downloading Files

How to transfer large data batches correctly.

Client configuration

The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.