Home > @i2analyze/i2connect > registerStorage
registerStorage() function
Registers local storage. That provides the user a way to write files to their own storage.
Signature:
export declare function registerStorage(config?: connectors.IRegisterStorageConfig): connectors.IRegisteredStorage;
Introduced: API version 2.4
Parameters
| Parameter | Type | Description |
|---|---|---|
| config | connectors.IRegisterStorageConfig | (Optional) The storage configuration, allows you to specify an optional auth handler to control access to written files. |
Returns:
The storage configuration.
Remarks
You can write files to the storage location using the writeFile method of the registered storage. Registering storage will register a handler that allows requests to read files from the storage location. The location given must be an absolute path.
Example
const storage = registerStorage();
addService(
{ name: 'Sample' },
() => {
storage.writeFile({fileId, content});
}
);