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_BDTgQbn9c5rXhPK3FCakms_7oKkdIWE1CCQFnSPftb2RxvloVqnYOcnsAKhXrD0Gq8Tz2Kgn5IBXG5E25uksZfvvTtXob-jFcuj_9LZYs9La4HrcFk766...";
NewName = "UpdatedFile.jpg";
Identifier = "1lZ0YvekgaZiJuZay2g2BiCAkRVrCjmNW";
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 "1bHoNG6lduQ07fDNrFrgOmXlW5AY9FEei" \
--file "https://hut.openintegrations.dev/test_data/picture2.jpg" \
--title "UpdatedFile.jpg"
oint gdrive UpdateFile ^
--token "***" ^
--object "1bHoNG6lduQ07fDNrFrgOmXlW5AY9FEei" ^
--file "https://hut.openintegrations.dev/test_data/picture2.jpg" ^
--title "UpdatedFile.jpg"
Result
{
"kind": "drive#file",
"id": "1bHoNG6lduQ07fDNrFrgOmXlW5AY9FEei",
"name": "UpdatedFile.jpg",
"mimeType": "image/jpeg"
}