Update file
Updates file binary data
Function UpdateFile(Val Token, Val Identifier, Val File, Val NewName = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Token |
| Identifier | --object | String | ✔ | Identifier of the object to update |
| File | --file | BinaryData,String | ✔ | File source for update |
| NewName | --title | String | ✖ | New file name (if necessary) |
Returns: Map Of KeyAndValue - serialized JSON response from Google
tip
Parameters with Binary data type can also accept file paths on disk and URLs
1C:Enterprise/OneScript code example
Token = "ya29.a0AQQ_BDQ_0g6De1s1jLOYbrGQ43QDri_VRPre92E-_aUXJNk52_zY1j3A74665Q7FVMzsgnjqjKN14ljBwB0PlswTyjZlgxcBIDMnuqIbFLhH8Hcxc5NfKIOpS...";
NewName = "UpdatedFile.jpg";
Identifier = "1gWSd3xX7y9I7s3wCP7avbkrUEK5VueKR";
File = "https://hut.openintegrations.dev/test_data/picture2.jpg"; // URL, Binary Data or File path
Result = OPI_GoogleDrive.UpdateFile(Token, Identifier, File, NewName);
- Bash
- CMD/Bat
oint gdrive UpdateFile \
--token "***" \
--object "1SdgrlViZM0g-ROR19eyFdWaooX8pZzZQ" \
--file "https://hut.openintegrations.dev/test_data/picture2.jpg" \
--title "UpdatedFile.jpg"
oint gdrive UpdateFile ^
--token "***" ^
--object "1SdgrlViZM0g-ROR19eyFdWaooX8pZzZQ" ^
--file "https://hut.openintegrations.dev/test_data/picture2.jpg" ^
--title "UpdatedFile.jpg"
Result
{
"kind": "drive#file",
"id": "1SdgrlViZM0g-ROR19eyFdWaooX8pZzZQ",
"name": "UpdatedFile.jpg",
"mimeType": "image/jpeg"
}