2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 5
|
|
|
|
---
|
|
|
|
|
|
|
|
# Download file
|
|
|
|
Download file from Telegram servers
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function DownloadFile(Val Token, Val FileID) Export`
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
| FileID | --fileid | String | File ID for downloading |
|
|
|
|
|
|
|
|
|
2024-06-07 08:47:43 +02:00
|
|
|
Returns: BinaryData - file's binary data
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
2024-07-31 20:55:27 +02:00
|
|
|
FileID = "CQACAgIAAx0EcNsaZQACGJNmk7UQ0Hl2KVCNMftHtaNRBoSLegACeVMAAp8joUj_Pam75oqJxTUE";
|
2024-06-05 12:19:46 +02:00
|
|
|
Token = "6129457865:AAFyzNYOAFbu...";
|
2024-06-05 12:35:05 +02:00
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
Result = OPI_Telegram.DownloadFile(Token, FileID);
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
|
|
|
oint telegram DownloadFile --token "6129457865:AAFyzNYOAFbu..." --fileid "AgACAgIAAx0EcNsaZQACE1lmXraQ7CsFNZ2Jrqimp9A0ir3mQQACmtkxG77-sUoMcnd_RvALsgEAAwIAA3MAAzUE"
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-06-09 00:01:18 +02:00
|
|
|
<Binary file's binary data>
|
2024-06-05 12:19:46 +02:00
|
|
|
```
|