1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-29 22:27:42 +02:00
Files
OpenIntegrations/docs/en/md/Bitrix24/File-management/Make-file-copy.mdx
Vitaly the Alpaca (bot) 50e6ac2e6d Main build (Jenkins)
2025-09-15 13:14:53 +03:00

89 lines
2.8 KiB
Plaintext
Vendored

---
sidebar_position: 8
description: Copy file and other functions to work with Bitrix24 in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Bitrix24]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Copy file
Copy file from one destination to another
`Function MakeFileCopy(Val URL, Val FileID, Val FolderID, Val Token = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| URL | --url | String | ✔ | URL of webhook or a Bitrix24 domain, when token used |
| FileID | --fileid | String, Number | ✔ | Original file ID |
| FolderID | --folderid | String, Number | ✔ | ID of copy destination folder |
| Token | --token | String | ✖ | Access token, when app auth method used |
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
<br/>
:::tip
Method at API documentation: [disk.file.copyto](https://dev.1c-bitrix.ru/rest_help/disk/file/disk_file_copyto.php)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
FolderID = "42172";
FileID = "42168";
URL = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";
Result = OPI_Bitrix24.MakeFileCopy(URL, FileID, FolderID);
FolderID = "42174";
URL = "b24-ar17wx.bitrix24.by";
Token = "75d8c668006e9f06006b12e400000001000...";
Result = OPI_Bitrix24.MakeFileCopy(URL, FileID, FolderID, Token);
```
```json title="Result"
{
"result": {
"ID": 42352,
"NAME": "New file name.jpg",
"CODE": null,
"STORAGE_ID": "3",
"TYPE": "file",
"PARENT_ID": "42336",
"DELETED_TYPE": 0,
"GLOBAL_CONTENT_VERSION": 1,
"FILE_ID": 28414,
"SIZE": "805189",
"CREATE_TIME": "2025-09-15T09:46:43+03:00",
"UPDATE_TIME": "2025-09-15T09:46:43+03:00",
"DELETE_TIME": null,
"CREATED_BY": "1",
"UPDATED_BY": "1",
"DELETED_BY": null,
"DOWNLOAD_URL": "https://b24-ar17wx.bitrix24.by/rest/download.json?auth=b8c3c768006e9f06006b12e4000000010000077ef10e1d2738b7b2b7d4c5a8cb98228c&token=disk%7CaWQ9NDIzNTImXz16azNleGJ2V0lZVzdpWkljV1puMjhtMzF0M0FCdUdBeg%3D%3D%7CImRvd25sb2FkfGRpc2t8YVdROU5ESXpOVEltWHoxNmF6TmxlR0oyVjBsWlZ6ZHBXa2xqVjFwdU1qaHRNekYwTTBGQ2RVZEJlZz09fGI4YzNjNzY4MDA2ZTlmMDYwMDZiMTJlNDAwMDAwMDAxMDAwMDA3N2VmMTBlMWQyNzM4YjdiMmI3ZDRjNWE4Y2I5ODIyOGMi.VSfpXISKb1kXw%2B%2BNChqro2CE3erMPydMKSyIoMrRIw4%3D",
"DETAIL_URL": "https://b24-ar17wx.bitrix24.by/docs/file/New catalog/New file name.jpg"
},
"time": {
"start": 1757918803.63886,
"finish": 1757918803.77559,
"duration": 0.136728048324585,
"processing": 0.106215000152588,
"date_start": "2025-09-15T09:46:43+03:00",
"date_finish": "2025-09-15T09:46:43+03:00",
"operating_reset_at": 1757919403,
"operating": 0.106189012527466
}
}
```