1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-07 07:10:01 +02:00
Vitaly the Alpaca (bot) 6f4de0ca5a Main build (Jenkins)
2024-10-15 13:51:58 +03:00

53 lines
1.3 KiB
Plaintext

---
sidebar_position: 8
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Update file
Updates file binary data
`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
<br/>
:::tip
Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>
```bsl title="Code example"
Token = "ya29.a0AcM612zdAe2M8Ywdxt7xmK1VAAj2m3yjTdP1Ap8cFmqbE8lVngjIAujPtjc_c94MCuKNLfn7MSssBd6NfMXDQDrHMUv7Fgjp7cjuXk68n...";
NewName = "UpdatedFile.jpg";
Identifier = "14hysfOxsStktI4JZEXRiSZ9Rl69wNJwX";
File = "https://api.athenaeum.digital/test_data/picture2.jpg"; // URL, Binary Data or Path to file
Result = OPI_GoogleDrive.UpdateFile(Token, Identifier, File, NewName);
```
```json title="Result"
{
"kind": "drive#file",
"id": "1slRtvK9Yap08a-wh_iE5go6dkCMwZrYH",
"name": "UpdatedFile.jpg",
"mimeType": "image/jpeg"
}
```