Skip to main content

Upload file by URL

Downloads a file to disk from the specified URL

Function UploadFileByURL(Val Token, Val Path, Val Address) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Path--pathStringPath to place the downloaded file
Address--urlStringFile URL

Returns: Map Of KeyAndValue - serialized JSON response from Yandex


1C:Enterprise/OneScript code example
    Token   = "y0_AgAAAABdylaOAAs0QgAAAAD5i-a...";
Address = "https://hut.openintegrations.dev/test_data/picture.jpg";
Path = "/" + String(New UUID) + ".png";

Result = OPI_YandexDisk.UploadFileByURL(Token, Path, Address);
    oint yadisk UploadFileByURL \
--token "***" \
--path "/39037f70-82d1-4344-8e3b-1a3229cdbc5b.png" \
--url "https://hut.openintegrations.dev/test_data/picture.jpg"
Result
{
"method": "GET",
"href": "https://cloud-api.yandex.net/v1/disk/operations/893a9db1e6d5945418e380209d3840689cc1274fb2e8150d8e1057f22be4427c",
"templated": false
}