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__xCOranuBRj1uTsgs8z_iRV...";
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 "/7ed81f5e-fba9-4812-98ac-50d0451dd9a8.png" \
--url "https://hut.openintegrations.dev/test_data/picture.jpg"
Result
{
"method": "GET",
"href": "https://cloud-api.yandex.net/v1/disk/operations/92a38af61da473d1640be3ad13a00d2a0c54bfc1a2e3b273f981...",
"templated": false
}