1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00
Files
OpenIntegrations/docs/en/md/Neocities/File-managment/Upload-file.mdx
T
Vitaly the Alpaca (bot) 20c8a991c5 Main build (Jenkins)
2024-10-15 13:51:58 +03:00

50 lines
1.0 KiB
Plaintext

---
sidebar_position: 1
---
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 | 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="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);
```
```json title="Result"
{
"result": "success",
"message": "your file(s) have been successfully uploaded"
}
```