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
tip
Neocities API docs: neocities.org/api
Parameters with Binary data type can also accept file paths on disk and URLs
1C:Enterprise/OneScript code example
Token = "f1e616e20ab5893b...";
Data = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Path or Binary Data
Path = "testfolder/test_pic.png";
Result = OPI_Neocities.UploadFile(Token, Path, Data);
- Bash
- CMD/Bat
oint neocities UploadFile \
--token "***" \
--path "testfolder/test_pic.png" \
--file "https://hut.openintegrations.dev/test_data/picture.jpg"
oint neocities UploadFile ^
--token "***" ^
--path "testfolder/test_pic.png" ^
--file "https://hut.openintegrations.dev/test_data/picture.jpg"
Result
{
"result": "success",
"message": "your file(s) have been successfully uploaded"
}