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.a0AT3oNZ89Gfvy6_DUg_tviJJnmBXSmGRrPL6Vym5gPCsPQEa3F606plSWJttyabLz5gHJY63An6XG9wKNlbVK4fkTSF_KNhqT5M6IGUm8THO6IWF0iGzg5z2SO...";
Identifier = "1oUMoSImbl8NKBVWQE9zkBdJ0QIPrkhtb";
Result = OPI_GoogleDrive.DownloadFile(Token, Identifier);
- Bash
- CMD/Bat
oint gdrive DownloadFile \
--token "***" \
--object "168lXYVR7WNtF0eUF0sCSsd1DB_YjuOmN"
oint gdrive DownloadFile ^
--token "***" ^
--object "168lXYVR7WNtF0eUF0sCSsd1DB_YjuOmN"
Result
"<Binary data>"