1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-01 22:29:52 +02:00
Files
OpenIntegrations/docs/en/md/Google_Drive/File-and-directory-management/Download-file.mdx
Vitaly the Alpaca (bot) c81cce789a Main build (Jenkins)
2025-04-24 11:36:13 +03:00

60 lines
1.5 KiB
Plaintext
Vendored

---
sidebar_position: 6
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Download file
Gets file by ID
`Function DownloadFile(Val Token, Val Identifier, Val SavePath = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| Identifier | --object | String | ✔ | File identifier |
| SavePath | --out | String | ✖ | File save path |
Returns: BinaryData,String - Binary data or file path when SavePath parameter is specified
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = "ya29.a0AZYkNZjOPXUBUxVXarYYqrsE6YSF1zDW9O-i_0rPrf8ldPdqZxhAjf05XPxqGs0kqepuqwg9wrQ2_Pi-JeahoWGSeAM0q0NW6ZogvnYsJ...";
Identifier = "1TSELE3f7xJGsC2ZYEPKAoqflAr1EWNIV";
Result = OPI_GoogleDrive.DownloadFile(Token, Identifier);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint gdrive DownloadFile \
--token "***" \
--object "1jzV6Bm86Q6kmJhHY20uo7M-l76kYLx-c"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint gdrive DownloadFile ^
--token "***" ^
--object "1jzV6Bm86Q6kmJhHY20uo7M-l76kYLx-c"
```
</TabItem>
</Tabs>
```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…
```