2024-10-15 10:50:56 +03:00
---
2024-08-13 15:52:26 +03:00
sidebar_position: 8
2025-05-05 11:15:20 +03:00
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
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Bitrix24]
2024-08-13 15:52:26 +03:00
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-08-13 15:52:26 +03:00
# Copy file
Copy file from one destination to another
2025-09-12 14:08:54 +03:00
`Function MakeFileCopy(Val URL, Val FileID, Val FolderID, Val Token = "") Export`
2024-08-13 15:52:26 +03:00
2024-10-15 15:15:47 +03:00
| 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 |
2024-08-13 15:52:26 +03:00
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
<br/>
:::tip
2024-11-21 13:27:18 +03:00
Method at API documentation: [disk.file.copyto](https://dev.1c-bitrix.ru/rest_help/disk/file/disk_file_copyto.php)
2024-08-13 15:52:26 +03:00
:::
<br/>
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-01 14:51:24 +03:00
FolderID = "40710";
FileID = "40706";
2024-08-13 16:47:32 +03:00
2025-06-29 14:35:33 +03:00
URL = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";
2024-08-13 16:47:32 +03:00
2025-09-12 14:08:54 +03:00
Result = OPI_Bitrix24.MakeFileCopy(URL, FileID, FolderID);
2024-08-13 16:47:32 +03:00
2025-09-01 14:51:24 +03:00
FolderID = "40712";
2024-08-13 16:47:32 +03:00
2025-06-29 14:35:33 +03:00
URL = "b24-ar17wx.bitrix24.by";
2025-09-04 15:33:26 +03:00
Token = "4f8db968006e9f06006b12e400000001000...";
2024-08-13 16:47:32 +03:00
2025-09-12 14:08:54 +03:00
Result = OPI_Bitrix24.MakeFileCopy(URL, FileID, FolderID, Token);
2024-08-13 15:52:26 +03:00
```
2024-10-15 09:53:37 +03:00
2024-08-13 15:52:26 +03:00
```json title="Result"
2024-08-14 09:06:31 +03:00
{
2025-09-12 14:08:54 +03:00
"result": {
"ID": 1744,
2024-08-14 09:06:31 +03:00
"NAME": "New file name.jpg",
"CODE": null,
"STORAGE_ID": "3",
"TYPE": "file",
2025-09-12 14:08:54 +03:00
"PARENT_ID": "1722",
2024-08-14 09:06:31 +03:00
"DELETED_TYPE": 0,
"GLOBAL_CONTENT_VERSION": 1,
2025-09-12 14:08:54 +03:00
"FILE_ID": 1146,
2024-08-14 09:06:31 +03:00
"SIZE": "805189",
2025-09-12 14:08:54 +03:00
"CREATE_TIME": "2024-07-03T14:42:54+00:00",
"UPDATE_TIME": "2024-07-03T14:42:54+00:00",
2024-08-14 09:06:31 +03:00
"DELETE_TIME": null,
"CREATED_BY": "1",
"UPDATED_BY": "1",
"DELETED_BY": null,
2025-09-12 14:08:54 +03:00
"DOWNLOAD_URL": "https://b24-ar17wx.bitrix24.by/rest/download.json?auth=fe708566006e9f06006b12e4000000010000076fcba303ea853529aed2cefade1444b3&token=disk%7CaWQ9MTc0NCZfPWphdFBTRXpUdHI2anZKbDNxMDBwVTdRRVZ4aDdGVTMy%7CImRvd25sb2FkfGRpc2t8YVdROU1UYzBOQ1pmUFdwaGRGQlRSWHBVZEhJMmFuWktiRE54TURCd1ZUZFJSVlo0YURkR1ZUTXl8ZmU3MDg1NjYwMDZlOWYwNjAwNmIxMmU0MDAwMDAwMDEwMDAwMDc2ZmNiYTMwM2VhODUzNTI5YWVkMmNlZmFkZTE0NDRiMyI%3D.uOKd1v3hEnu7vsep0NhRk3RzXtyT21DBrrwPl3DxLG8%3D",
2024-08-14 09:06:31 +03:00
"DETAIL_URL": "https://b24-ar17wx.bitrix24.by/docs/file/New catalog/New file name.jpg"
2025-09-12 14:08:54 +03:00
},
"time": {
"start": 1720017774.37632,
"finish": 1720017774.44715,
"duration": 0.07082200050354,
"processing": 0.0407531261444092,
"date_start": "2024-07-03T14:42:54+00:00",
"date_finish": "2024-07-03T14:42:54+00:00",
"operating_reset_at": 1720018374,
2024-08-14 09:06:31 +03:00
"operating": 0
2025-09-12 14:08:54 +03:00
}
}
2024-08-13 15:52:26 +03:00
```