---
sidebar_position: 2
description: Upload files and other functions to work with Neocities 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, Neocities]
---

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

# Upload files
 Uploads multiple files to Neocities



`Function UploadFiles(Val Token, Val FileMapping, Val Singly = False) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Auth token |
  | FileMapping | --files | Map Of KeyAndValue | &#x2714; | Files: Key > destination path on NC, Value > file |
  | Singly | --singly | Boolean | &#x2716; | True > sends files in separate requests |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Neocities

:::tip
Neocities API docs: [neocities.org/api](https://neocities.org/api)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Token = "f1e616e20ab5893b...";

    Image1 = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Path or Binary Data
    Image2 = "https://hut.openintegrations.dev/test_data/picture2.jpg"; // URL, Path or Binary Data
    GIF    = "https://hut.openintegrations.dev/test_data/animation.gif"; // URL, Path or Binary Data

    FileMapping = New Map;
    FileMapping.Insert("test/pic1.png", Image1);
    FileMapping.Insert("test/gif.gif" , Image2);
    FileMapping.Insert("pic2.png"     , GIF);

    Result = OPI_Neocities.UploadFiles(Token, FileMapping);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint neocities UploadFiles \
             --token "***" \
             --files "{'test/pic1.png':'https://hut.openintegrations.dev/test_data/picture.jpg','test/gif.gif':'https://hut.openintegrations.dev/test_data/picture2.jpg','pic2.png':'https://hut.openintegrations.dev/test_data/animation.gif'}"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint neocities UploadFiles ^
             --token "***" ^
             --files "{'test/pic1.png':'https://hut.openintegrations.dev/test_data/picture.jpg','test/gif.gif':'https://hut.openintegrations.dev/test_data/picture2.jpg','pic2.png':'https://hut.openintegrations.dev/test_data/animation.gif'}"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "result": "success",
 "message": "your file(s) have been successfully uploaded"
}
```
