1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-29 22:27:42 +02:00
Files
OpenIntegrations/docs/en/md/Telegram/Data-retrieval-and-settings/Download-file.mdx

64 lines
1.9 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 5
2025-05-05 11:15:20 +03:00
description: Download file and other functions to work with Telegram in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Telegram]
2024-10-15 10:16:04 +03:00
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Download file
Download file from Telegram servers
`Function DownloadFile(Val Token, Val FileID) Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| FileID | --fileid | String | ✔ | File ID for downloading |
2024-10-15 10:16:04 +03:00
Returns: BinaryData - file's binary data
<br/>
:::tip
2024-11-21 13:27:18 +03:00
Method at API documentation: [getFile](https://core.telegram.org/bots/api#getfile)
2024-10-15 10:16:04 +03:00
:::
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2025-09-15 13:14:53 +03:00
FileID = "CQACAgIAAx0EcNsaZQACUL5oxtZxTAF37mtQa89Nqv8gbBvdbQACnYcAAmMlOUrfHJ36K_ssgzYE";
2025-06-29 14:35:33 +03:00
Token = "6129457865:AAFyzNYOAFbu...";
2024-10-15 10:16:04 +03:00
Result = OPI_Telegram.DownloadFile(Token, FileID);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint telegram DownloadFile \
2024-10-22 08:59:24 +03:00
--token "***" \
2025-09-16 09:07:33 +03:00
--fileid "CQACAgIAAx0EcNsaZQACUZBoyIQchkhcIAQFgTglQyjK2Ql4LwACnG4AAopjSUqwDOjhJaUJUzYE"
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint telegram DownloadFile ^
2024-10-22 08:59:24 +03:00
--token "***" ^
2025-09-16 09:07:33 +03:00
--fileid "CQACAgIAAx0EcNsaZQACUZBoyIQchkhcIAQFgTglQyjK2Ql4LwACnG4AAopjSUqwDOjhJaUJUzYE"
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
NOT JSON: 49 44 33 03 00 00 00 05 1F 76 54 49 54 32 00 00 00 0B 00 00 01 FF FE 44 00 6F 00 67 00 73 00 54 50 45 31 00 00 00 15 00 00 01 FF FE 4D 00 6F 00 74 00 6F 00 72 00 68 00 65 00 61 00 64 00 54 59…
```