1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-05 22:53:35 +02:00
Files
OpenIntegrations/docs/en/md/Neocities/File-management/Upload-file.mdx
Vitaly the Alpaca (bot) b9d345b8d8 Main build (Jenkins)
2025-05-05 11:15:20 +03:00

74 lines
2.1 KiB
Plaintext
Vendored

---
sidebar_position: 1
description: Upload file 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 file
Upload single file to Neocities
`Function UploadFile(Val Token, Val Path, Val Data) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Auth token |
| Path | --path | String | ✔ | File path on Neocities |
| Data | --file | String, BinaryData | ✔ | URL, path or file data |
Returns: Map Of KeyAndValue - serialized JSON response from Neocities
<br/>
:::tip
Neocities API docs: [neocities.org/api](https://neocities.org/api)
Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = "7419cd51de4037f7...";
Data = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data
Path = "testfolder/test_pic.png";
Result = OPI_Neocities.UploadFile(Token, Path, Data);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint neocities UploadFile \
--token "***" \
--path "testfolder/test_pic.png" \
--file "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint neocities UploadFile ^
--token "***" ^
--path "testfolder/test_pic.png" ^
--file "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg"
```
</TabItem>
</Tabs>
```json title="Result"
{
"result": "success",
"message": "your file(s) have been successfully uploaded"
}
```