Skip to main content

Download file

Gets file by ID

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

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Identifier--objectStringFile identifier
SavePath--outStringFile save path

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


1C:Enterprise/OneScript code example
    Token      = "ya29.a0AQQ_BDTgQbn9c5rXhPK3FCakms_7oKkdIWE1CCQFnSPftb2RxvloVqnYOcnsAKhXrD0Gq8Tz2Kgn5IBXG5E25uksZfvvTtXob-jFcuj_9LZYs9La4HrcFk766...";
Identifier = "1lZ0YvekgaZiJuZay2g2BiCAkRVrCjmNW";

Result = OPI_GoogleDrive.DownloadFile(Token, Identifier);
    oint gdrive DownloadFile \
--token "***" \
--object "1bHoNG6lduQ07fDNrFrgOmXlW5AY9FEei"
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