1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-03-27 21:48:56 +02:00

53 lines
1.2 KiB
Markdown
Raw Normal View History

---
sidebar_position: 8
---
# Update file
Updates file binary data
2024-07-10 13:58:29 +03:00
`Function UpdateFile(Val Token, Val Identifier, Val File, Val NewName = "") Export`
| Parameter | CLI option | Type | 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
2024-07-10 14:05:58 +03:00
<br/>
2024-07-10 13:58:29 +03:00
```bsl title="Code example"
NewName = "Updated file.jpeg";
ReplacementImage = "C:\OPI\image2.jpg";
Identifier = "1V0oaZh3qQZ7-wbARC8-vrErAFllsBGSJ";
Response = OPI_GoogleDrive.UpdateFile(Token, Identifier, ReplacementImage, NewName) //Map
Response = OPI_Tools.JSONString(Response); //String
```
```sh title="CLI command example"
oint gdrive UpdateFile --token %token% --object "1V0oaZh3qQZ7-wbARC8-vrErAFllsBGSJ" --file %file% --title %title%
```
```json title="Result"
2024-08-14 09:06:31 +03:00
{
"mimeType": "image/jpeg",
"name": "UpdatedFile.jpg",
"id": "1V0oaZh3qQZ7-wbARC8-vrErAFllsBGSJ",
"kind": "drive#file"
}
```