1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-01-20 05:19:32 +02:00

48 lines
1.0 KiB
Markdown
Raw Normal View History

---
sidebar_position: 10
---
# Upload file
Uploads a file to disk at the specified path
2024-07-10 13:58:29 +03:00
`Function UploadFile(Val Token, Val Path, Val File, Val Overwrite = False) Export`
| Parameter | CLI option | Type | Destination |
|-|-|-|-|
| Token | --token | String | Token |
| Path | --path | String | Path for saving the file to disk |
| File | --file | String, BinaryData | File for upload |
| Overwrite | --rewrite | Boolean | Overwrite if a file with the same name already exists |
Returns: Map Of KeyAndValue - serialized JSON response from Yandex
2024-07-10 14:05:58 +03:00
<br/>
2024-07-10 13:58:29 +03:00
```bsl title="Code example"
2024-07-10 14:24:11 +03:00
Token = "y0_AgAAAABdylaOAA...";
Path = "/AlpacaInFile.png";
File = "C:\logo.png";
Response = OPI_YandexDisk.UploadFile(Token, Path, File); //Map
Response = OPI_Tools.JSONString(Response); //String
```
```sh title="CLI command example"
oint yadisk UploadFile --token "y0_AgAAAABdylaOAA..." --path "/AlpacaInFile.png" --file "C:\logo.png" --rewrite %rewrite%
```
```json title="Result"
2024-07-10 14:11:17 +03:00
<empty string>
```