---
sidebar_position: 12
description: Upload file in parts and other functions to work with Yandex Disk 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, Yandex Disk]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Upload file in parts
 Uploads a file to disk at the specified path in parts



`Function UploadFileInParts(Val Token, Val Path, Val File, Val ChunkSize = 33554432, Val Overwrite = False) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Token |
  | Path | --path | String | &#x2714; | Path for saving the file to disk |
  | File | --file | String, BinaryData | &#x2714; | File for upload |
  | ChunkSize | --psize | Number | &#x2716; | Part size when uploading |
  | Overwrite | --rewrite | Boolean | &#x2716; | Overwrite if a file with the same name already exists |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Yandex

:::tip
Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Path = "/song.mp3";

    Token = "y0__xCOranuBRj1uTsgs8z_iRV...";
    File  = "https://hut.openintegrations.dev/test_data/song.mp3"; // URL, Binary or File path

    ChunkSize = 1048576; // 1 MB

    Result = OPI_YandexDisk.UploadFileInParts(Token, Path, File, ChunkSize, True);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint yadisk UploadFileInParts \
             --token "***" \
             --path "/song.mp3" \
             --file "https://hut.openintegrations.dev/test_data/song.mp3" \
             --psize 1048576 \
             --rewrite true
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint yadisk UploadFileInParts ^
             --token "***" ^
             --path "/song.mp3" ^
             --file "https://hut.openintegrations.dev/test_data/song.mp3" ^
             --psize 1048576 ^
             --rewrite true
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "status": 201
}
```
