Skip to main content

Upload file in parts

Uploads a file to disk at the specified path in parts

Function UploadFileInParts(Val Token, Val Path, Val File, Val ChunkSize = 33554432, Val Overwrite = False) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Path--pathStringPath for saving the file to disk
File--fileString, BinaryDataFile for upload
ChunkSize--psizeNumberPart size when uploading
Overwrite--rewriteBooleanOverwrite if a file with the same name already exists
Returns

Map Of KeyAndValue - serialized JSON response from Yandex

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);
oint yadisk UploadFileInParts \
--token "***" \
--path "/song.mp3" \
--file "https://hut.openintegrations.dev/test_data/song.mp3" \
--psize 1048576 \
--rewrite true
Result
{
"status": 201
}