2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 6
2025-05-05 11:15:20 +03:00
description: Download file and other functions to work with Google Drive 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, Google Drive]
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
Gets file by ID
`Function DownloadFile(Val Token, Val Identifier, Val SavePath = "") Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| Identifier | --object | String | ✔ | File identifier |
| SavePath | --out | String | ✖ | File save path |
2024-10-15 10:16:04 +03:00
Returns: BinaryData,String - Binary data or file path when SavePath parameter is specified
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2025-10-29 21:59:54 +03:00
Token = "ya29.a0ATi6K2vDW-Vv1H04Laa7CH4aF_93Z7LtfD1VoGLPCWCYErIG_1l_DAwwozCcosZGjJ8Pw0i45BG5ojbNDczD3Iskrwrl_K7jf7N7dHe0f5kYLvKyhDmT3AO2m...";
Identifier = "1D8bOu1xHYQ6lMyXyf0NEL8ucTj9GUMzl";
2024-10-15 10:16:04 +03:00
Result = OPI_GoogleDrive.DownloadFile(Token, Identifier);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint gdrive DownloadFile \
2024-10-22 08:59:24 +03:00
--token "***" \
2025-10-15 14:32:00 +03:00
--object "1SdgrlViZM0g-ROR19eyFdWaooX8pZzZQ"
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint gdrive DownloadFile ^
2024-10-22 08:59:24 +03:00
--token "***" ^
2025-10-15 14:32:00 +03:00
--object "1SdgrlViZM0g-ROR19eyFdWaooX8pZzZQ"
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
NOT JSON: FF D8 FF E1 54 C1 45 78 69 66 00 00 49 49 2A 00 08 00 00 00 0B 00 0E 01 02 00 20 00 00 00 92 00 00 00 0F 01 02 00 05 00 00 00 B2 00 00 00 10 01 02 00 07 00 00 00 B8 00 00 00 12 01 03 00 01 00…
```