Skip to main content

Download file

Downloads a file at the specified path

Function DownloadFile(Val Token, Val Path, Val SavePath = "") Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Path--pathStringPath to the file for downloading
SavePath--outStringFile save path

Returns: BinaryData,String - Binary data or file path when SavePath parameter is specified


1C:Enterprise/OneScript code example
    Token = "y0_AgAAAABdylaOAAs0QgAAAAD5i-a...";
Path = "/97ae4d9e-7314-4f1d-8acb-37885235cae2.png";

Result = OPI_YandexDisk.DownloadFile(Token, Path);
    oint yadisk DownloadFile \
--token "***" \
--path "/2cd1e258-1832-4da5-ae43-eedc044ce5e0.png"
Result
NOT JSON: FF D8 FF E1 54 C1 45 78 69 66 00 00 49 49 2A 00 08 00 00 00 0B 00 0E 01 02 00 20 00 00 00 92 00 00 00 0F 01 02 00 05 00 00 00 B2 00 00 00 10 01 02 00 07 00 00 00 B8 00 00 00 12 01 03 00 01 00