1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-06-02 23:27:50 +02:00
Vitaly the Alpaca (bot) 36a4920eb7 Main build (Jenkins)
2025-01-11 21:13:24 +03:00

76 lines
2.1 KiB
Plaintext
Vendored

---
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 | 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
<br/>
:::tip
Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = "ya29.a0ARW5m74eRsl1DAAdxlovoi-Df8oZ2JjSlTvfq0WCV2MtxYK3cHV0O7rHGNIuSABPcqh6Ok0GnUZGw1k2_nl4ExSWkjExTaDr0QyABTVfv...";
NewName = "UpdatedFile.jpg";
Identifier = "1dBUL_boVzkYTTih-vwrI4r1qilSHVGGt";
File = "https://api.athenaeum.digital/test_data/picture2.jpg"; // URL, Binary Data or Path to file
Result = OPI_GoogleDrive.UpdateFile(Token, Identifier, File, NewName);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint gdrive UpdateFile \
--token "***" \
--object "1W_FHojYzsBLfmmILZZ8yL57pF4DJ4VVz" \
--file "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg" \
--title "UpdatedFile.jpg"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint gdrive UpdateFile ^
--token "***" ^
--object "1W_FHojYzsBLfmmILZZ8yL57pF4DJ4VVz" ^
--file "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg" ^
--title "UpdatedFile.jpg"
```
</TabItem>
</Tabs>
```json title="Result"
{
"kind": "drive#file",
"id": "1slRtvK9Yap08a-wh_iE5go6dkCMwZrYH",
"name": "UpdatedFile.jpg",
"mimeType": "image/jpeg"
}
```