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 "/85adb453-65ab-438a-8cd3-216778e18179.png" \
--url "https://hut.openintegrations.dev/test_data/picture.jpg"
Result
{
"method": "GET",
"href": "https://cloud-api.yandex.net/v1/disk/operations/58dbfb25ddd8a2d5ff2cea4b6a6b90f3bd4545ee8e43b943788db5371d1f5ee3",
"templated": false
}