1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-27 22:18:36 +02:00
Files
OpenIntegrations/docs/en/md/Telegram/Data-retrieval-and-settings/Download-file.mdx
Vitaly the Alpaca (bot) abbcdf3723 Main build (Jenkins)
2025-09-18 13:55:48 +03:00

64 lines
1.9 KiB
Plaintext
Vendored

---
sidebar_position: 5
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
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Telegram]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Download file
Download file from Telegram servers
`Function DownloadFile(Val Token, Val FileID) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| FileID | --fileid | String | ✔ | File ID for downloading |
Returns: BinaryData - file's binary data
<br/>
:::tip
Method at API documentation: [getFile](https://core.telegram.org/bots/api#getfile)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
FileID = "CQACAgIAAx0EcNsaZQACUL5oxtZxTAF37mtQa89Nqv8gbBvdbQACnYcAAmMlOUrfHJ36K_ssgzYE";
Token = "6129457865:AAFyzNYOAFbu...";
Result = OPI_Telegram.DownloadFile(Token, FileID);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint telegram DownloadFile \
--token "***" \
--fileid "CQACAgIAAx0EcNsaZQACUZBoyIQchkhcIAQFgTglQyjK2Ql4LwACnG4AAopjSUqwDOjhJaUJUzYE"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint telegram DownloadFile ^
--token "***" ^
--fileid "CQACAgIAAx0EcNsaZQACUZBoyIQchkhcIAQFgTglQyjK2Ql4LwACnG4AAopjSUqwDOjhJaUJUzYE"
```
</TabItem>
</Tabs>
```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…
```