Upload files
Uploads multiple files to Neocities
- Parameters
- Advanced call ?
Function UploadFiles(Val Token, Val FileMapping, Val Singly = False) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Auth token |
| FileMapping | --files | Map Of KeyAndValue | ✔ | Files: Key > destination path on NC, Value > file |
| Singly | --singly | Boolean | ✖ | True > sends files in separate requests |
Returns
Map Of KeyAndValue - serialized JSON response from Neocities
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
tip
Neocities API docs: neocities.org/api
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);
- Bash
- CMD/Bat
# 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'}"
:: 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'}"
Result
{
"result": "success",
"message": "your file(s) have been successfully uploaded"
}