Net - globules-io/OGX.JS GitHub Wiki
Net
is a static class that acts as a file loader.Net
caches then the loaded file in Cache. It automatically preloads everything found in thepreload
node of yourapp.json
.
To check out this page to learn to use the
prepare
command of the CLI to prepare your app and automatically add files to preload to yourapp.json
config.
Methods
Load
Load files and store them into the cache
OGX.Net.load(_FILEPATH_, _CALLBACK_, _PARAMS_);
Example
OGX.Net.load('/img/my.png', () => {...});
1.32.0+
Upload To trigger the file upload/select process
OGX.Net.upload(_EXT_, _MULTIPLE_FILES_, _CALLBACK_);
Example
OGX.Net.upload(['.png', '.jpg'], true, (__files) => {...});
1.33.0+
Download Automatically create a download link and click it
OGX.Net.download(_STRING_);
Example
OGX.Net.download('https://myserver.com/myfile.png');