2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 11
|
|
|
|
---
|
|
|
|
|
|
|
|
# Upload file by URL
|
|
|
|
Downloads a file to disk from the specified URL
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function UploadFileByURL(Val Token, Val Path, Val Address) Export`
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
| Path | --path | String | Path to place the downloaded file |
|
|
|
|
| Address | --url | String | File URL |
|
|
|
|
|
|
|
|
|
2024-06-06 14:33:52 +02:00
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Yandex
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
|
|
|
|
|
|
|
Token = "y0_AgAAAABdylaOAA...";
|
|
|
|
Path = "/Alpaca.png";
|
|
|
|
Address = "https://raw.githubusercontent.com/Bayselonarrend/OpenIntegrations/main/Media/logo.png";
|
|
|
|
|
|
|
|
Response = OPI_YandexDisk.UploadFileByURL(Token, Path, Address); //Map
|
|
|
|
Response = OPI_Tools.JSONString(Response); //String
|
|
|
|
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
|
|
|
oint yadisk UploadFileByURL --token "y0_AgAAAABdylaOAA..." --path "/Alpaca.png" --url "https://raw.githubusercontent.com/Bayselonarrend/OpenIntegrations/main/Media/logo.png"
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 10:59:55 +02:00
|
|
|
{
|
2024-06-05 12:19:46 +02:00
|
|
|
"templated": false,
|
|
|
|
"method": "GET",
|
|
|
|
"href": "https://cloud-api.yandex.net/v1/disk/operations/b78a7ef2dd49971aa22e5e72f2e615db885da9947d7c61b2822de23a99e855a1"
|
|
|
|
}
|
|
|
|
```
|