1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-01 22:29:52 +02:00
Files
OpenIntegrations/docs/en/md/Google_Drive/File-and-directory-management/Update-file.mdx

78 lines
2.4 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 8
2025-05-05 11:15:20 +03:00
description: Update file and other functions to work with Google Drive in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Google Drive]
2024-10-15 10:16:04 +03:00
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Update file
Updates file binary data
`Function UpdateFile(Val Token, Val Identifier, Val File, Val NewName = "") Export`
2024-10-15 15:15:47 +03:00
| 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) |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Google
<br/>
2024-10-15 13:51:58 +03:00
:::tip
Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>
2024-10-15 10:16:04 +03:00
2024-12-16 19:38:57 +03:00
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2025-09-12 16:37:40 +03:00
Token = "ya29.a0AS3H6NwrH32o3TZZmc3e_ByEcGAt2XTmAPcv99GD_9QwcQfnRxKuI-SiaY_8supYx1k4moGVpqwHhRCIfTJiGob3aJdVZrAGlzpNd-xICMBDGVrfB-eNxg-2l...";
2024-10-15 10:16:04 +03:00
NewName = "UpdatedFile.jpg";
2025-09-12 16:37:40 +03:00
Identifier = "1Uue498nE8oxvNqB9Za00HJGPe3ois84-";
2025-06-29 14:35:33 +03:00
File = "https://hut.openintegrations.dev/test_data/picture2.jpg"; // URL, Binary Data or File path
2024-10-15 10:16:04 +03:00
Result = OPI_GoogleDrive.UpdateFile(Token, Identifier, File, NewName);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint gdrive UpdateFile \
2024-10-22 08:59:24 +03:00
--token "***" \
2025-07-15 23:11:07 +03:00
--object "1FYM8U7Y_rkouPeJxj5CgJiY9dvvXl57z" \
2025-07-05 18:56:59 +03:00
--file "https://hut.openintegrations.dev/test_data/picture2.jpg" \
2024-10-22 08:59:24 +03:00
--title "UpdatedFile.jpg"
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint gdrive UpdateFile ^
2024-10-22 08:59:24 +03:00
--token "***" ^
2025-07-15 23:11:07 +03:00
--object "1FYM8U7Y_rkouPeJxj5CgJiY9dvvXl57z" ^
2025-07-05 18:56:59 +03:00
--file "https://hut.openintegrations.dev/test_data/picture2.jpg" ^
2024-10-22 08:59:24 +03:00
--title "UpdatedFile.jpg"
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
{
"kind": "drive#file",
2025-09-12 20:23:31 +03:00
"id": "1UIEbHbt01BKP08XEq-B3MVr4BS_atS6p",
2024-10-15 10:16:04 +03:00
"name": "UpdatedFile.jpg",
"mimeType": "image/jpeg"
}
```