---
sidebar_position: 11
description: Upload file 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
 Uploads a file to disk at the specified path



`Function UploadFile(Val Token, Val Path, Val File, 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 |
  | 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"
    Path1 = "/" + String(New UUID) + ".png";
    Path2 = "/" + String(New UUID) + ".png";

    Token = "y0__xCOranuBRj1uTsgs8z_iRV...";
    Image = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL

    TFN = GetTempFileName("png"); // Path
    CopyFile(Image, TFN);

    Result = OPI_YandexDisk.UploadFile(Token, Path1, Image, True);

    Result = OPI_YandexDisk.UploadFile(Token, Path2, TFN, True);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint yadisk UploadFile \
             --token "***" \
             --path "/c812b0b5-a59a-4e19-887e-25a5ddc7bfd9.png" \
             --file "/tmp/qifc05f5.dpg.png" \
             --rewrite true
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint yadisk UploadFile ^
             --token "***" ^
             --path "/c812b0b5-a59a-4e19-887e-25a5ddc7bfd9.png" ^
             --file "/tmp/qifc05f5.dpg.png" ^
             --rewrite true
        ```
    </TabItem>
</Tabs>


```json title="Result"
{}
```
