Upload file by URL
Downloads a file to disk from the specified URL
- Parameters
- Advanced call ?
Function UploadFileByURL(Val Token, Val Path, Val Address) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Token |
| Path | --path | String | ✔ | Path to place the downloaded file |
| Address | --url | String | ✔ | File URL |
Returns
Map Of KeyAndValue - serialized JSON response from Yandex
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
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);
- Bash
- CMD/Bat
oint yadisk UploadFileByURL \
--token "***" \
--path "/7ed81f5e-fba9-4812-98ac-50d0451dd9a8.png" \
--url "https://hut.openintegrations.dev/test_data/picture.jpg"
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
}