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 optionTypeDescription
Token--tokenStringToken
Path--pathStringPath to place the downloaded file
Address--urlStringFile URL

Returns: Map Of KeyAndValue - serialized JSON response from Yandex


Code example
    Token   = "y0_AgAAAABdylaOAAs0QgAAAAD5i-a...";
Address = "https://openintegrations.dev/test_data/picture.jpg";
Path = "/" + String(New UUID) + ".png";

Result = OPI_YandexDisk.UploadFileByURL(Token, Path, Address);
CLI command example
    
oint yadisk UploadFileByURL --token "y0_AgAAAABdylaOAA..." --path "/Alpaca.png" --url "https://raw.githubusercontent.com/Bayselonarrend/OpenIntegrations/main/Media/logo.png"

Result
{
"templated": false,
"method": "GET",
"href": "https://cloud-api.yandex.net/v1/disk/operations/b78a7ef2dd49971aa22e5e72f2e615db885da9947d7c61b2822de23a99e855a1"
}