Download file
Gets file by ID
- Parameters
- Advanced call ?
Function DownloadFile(Val Token, Val Identifier, Val SavePath = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Token |
| Identifier | --object | String | ✔ | File identifier |
| 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 = "ya29.a0ATi6K2sWW_31WLH0d9aK0qk0HJ-UfyvZDcLeBbF5bLU7QH09Bx2pXAupIw40USQVaxXqsovItVSt9swWuPdBDSA0eFaVPE0CbaU2OLQlyrnITI1VVXgZ_Gx2R...";
Identifier = "1oUMoSImbl8NKBVWQE9zkBdJ0QIPrkhtb";
Result = OPI_GoogleDrive.DownloadFile(Token, Identifier);
- Bash
- CMD/Bat
oint gdrive DownloadFile \
--token "***" \
--object "166h2PA-akB9UXJachoasK34TDzPseLSX"
oint gdrive DownloadFile ^
--token "***" ^
--object "166h2PA-akB9UXJachoasK34TDzPseLSX"
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…