Download file
Downloads a file at the specified path
- Parameters
- Advanced call ?
Function DownloadFile(Val Token, Val Path, Val SavePath = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Token |
| Path | --path | String | ✔ | Path to the file for downloading |
| SavePath | --out | String | ✖ | File save path |
Returns
BinaryData,String - Binary data or file path when SavePath parameter is specified
| 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...";
Path = "/c20d5eca-8524-41ce-aa92-521e71dd6b17.png";
Result = OPI_YandexDisk.DownloadFile(Token, Path);
- Bash
- CMD/Bat
oint yadisk DownloadFile \
--token "***" \
--path "/c003220e-09ab-438e-b6cd-911f1ed81f90.png"
oint yadisk DownloadFile ^
--token "***" ^
--path "/c003220e-09ab-438e-b6cd-911f1ed81f90.png"
Result
"<Binary data>"