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.a0AeDClZCuUGv3lVO8dyhcLNhY08vE-ingztWRKkv-QAvcs9f6z1x0StyUs2M2YRgdoHDpUUEeBm5wAfquh5Z2_afLxDoqTIrStzOWxDL66...";
NewName = "UpdatedFile.jpg";
Identifier = "1B3puP5eRsgt4oMUKbzZOE0K7H-cISZ_y";
File = "https://api.athenaeum.digital/test_data/picture2.jpg"; // URL, Binary Data or Path to file
Result = OPI_GoogleDrive.UpdateFile(Token, Identifier, File, NewName);
- Bash
- CMD/Bat
oint gdrive UpdateFile \
--token "***" \
--object "1TW-ZQ8baR09gA83J89zSLKA6kmCqHB34" \
--file "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg" \
--title "UpdatedFile.jpg"
oint gdrive UpdateFile ^
--token "***" ^
--object "1TW-ZQ8baR09gA83J89zSLKA6kmCqHB34" ^
--file "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg" ^
--title "UpdatedFile.jpg"
Result
{
"kind": "drive#file",
"id": "1slRtvK9Yap08a-wh_iE5go6dkCMwZrYH",
"name": "UpdatedFile.jpg",
"mimeType": "image/jpeg"
}