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 the preload node of your app.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 your app.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', () => {...});

Upload 1.32.0+

To trigger the file upload/select process

 OGX.Net.upload(_EXT_, _MULTIPLE_FILES_, _CALLBACK_);

Example

 OGX.Net.upload(['.png', '.jpg'], true, (__files) => {...});

Download 1.33.0+

Automatically create a download link and click it

 OGX.Net.download(_STRING_);

Example

OGX.Net.download('https://myserver.com/myfile.png');