--- sidebar_position: 5 --- 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
:::tip Method at API documentation: [getFile](https://core.telegram.org/bots/api#getfile) :::
```bsl title="1C:Enterprise/OneScript code example" FileID = "CQACAgIAAx0EcNsaZQACKyVnMkHGSSPgyEdlGjr4LLSsEniXrAAC6WQAAvd-kElvlw5ymJEx6zYE"; Token = "6129457865:AAFyzNYOAFbu..."; Result = OPI_Telegram.DownloadFile(Token, FileID); ``` ```bash oint telegram DownloadFile \ --token "***" \ --fileid "CQACAgIAAx0EcNsaZQACLGtnOdjbW3DukG4aO0a8-aq8zSAZYAAC1FcAAuUi0EmDCwW9T6LLFTYE" ``` ```batch oint telegram DownloadFile ^ --token "***" ^ --fileid "CQACAgIAAx0EcNsaZQACLGtnOdjbW3DukG4aO0a8-aq8zSAZYAAC1FcAAuUi0EmDCwW9T6LLFTYE" ``` ```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… ```