Skip to main content

Upload files

Uploads multiple files to Neocities

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

ParameterCLI optionTypeRequiredDescription
Token--tokenStringAuth token
FileMapping--filesMap Of KeyAndValueFiles: Key > destination path on NC, Value > file
Singly--singlyBooleanTrue > sends files in separate requests

Returns: Map Of KeyAndValue - serialized JSON response from Neocities


tip

Neocities API docs: neocities.org/api


1C:Enterprise/OneScript code example
    Token = "7419cd51de4037f7...";

Image1 = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data
Image2 = "https://api.athenaeum.digital/test_data/picture2.jpg"; // URL, Path or Binary Data
GIF = "https://api.athenaeum.digital/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);
    # JSON data can also be passed as a path to a .json file

oint neocities UploadFiles \
--token "***" \
--files "{'test/pic1.png':'https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg','test/gif.gif':'https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg','pic2.png':'https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/animation.gif'}"
Result
{
"result": "success",
"message": "your file(s) have been successfully uploaded"
}