Upload file in parts
Uploads a file to disk at the specified path in parts
- Parameters
- Advanced call ?
Function UploadFileInParts(Val Token, Val Path, Val File, Val ChunkSize = 33554432, Val Overwrite = False) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Token |
| Path | --path | String | ✔ | Path for saving the file to disk |
| File | --file | String, BinaryData | ✔ | File for upload |
| ChunkSize | --psize | Number | ✖ | Part size when uploading |
| Overwrite | --rewrite | Boolean | ✖ | Overwrite if a file with the same name already exists |
Returns
Map Of KeyAndValue - serialized JSON response from Yandex
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
tip
Parameters with Binary data type can also accept file paths on disk and URLs
1C:Enterprise/OneScript code example
Path = "/song.mp3";
Token = "y0__xCOranuBRj1uTsgs8z_iRV...";
File = "https://hut.openintegrations.dev/test_data/song.mp3"; // URL, Binary or File path
ChunkSize = 1048576; // 1 MB
Result = OPI_YandexDisk.UploadFileInParts(Token, Path, File, ChunkSize, True);
- Bash
- CMD/Bat
oint yadisk UploadFileInParts \
--token "***" \
--path "/song.mp3" \
--file "https://hut.openintegrations.dev/test_data/song.mp3" \
--psize 1048576 \
--rewrite true
oint yadisk UploadFileInParts ^
--token "***" ^
--path "/song.mp3" ^
--file "https://hut.openintegrations.dev/test_data/song.mp3" ^
--psize 1048576 ^
--rewrite true
Result
{
"status": 201
}