Skip to main content

Document Management - configuring File Storage Manager

To start using Document Management, specify your STORAGE_STRATEGY in your system-definition.kts.

STORAGE_STRATEGY supports the following values:

  • LOCAL
  • AWS
  • SHAREPOINT
  • SHAREPOINT_ON_PREM
item(name = "STORAGE_STRATEGY", value = "<strategy>")

Once you have set your STORAGE_STRATEGY, you must configure the storage solution that you are going to use. The requirements for each solution are described below.

Local file storage

When using local file storage, your files are stored under your specified folder inside your genesis-home/runtime/fileupload/ folder, which is created automatically.

When using Local File Storage, your files are stored under genesis-home/runtime/fileupload/. You can optionally specify your own sub-directory under this.

If you do, the framework will automatically create it for you. If no additional directory path is required, it will default to genesis-home/runtime/fileupload/LOCAL_STORAGE.

item(name = "LOCAL_STORAGE_FOLDER", value = "<folderName>")

AWS S3

When using AWS S3 as your storage solution, you must have an S3 bucket created either locally or remotely.

Once this is available, there are four steps you need to take to configure AWS S3:

  1. Set your S3_STORAGE_MODE.
item(name = "S3_STORAGE_MODE", value = "<storageMode>")

S3_STORAGE_MODE can be:

  • LOCAL (app running locally on your development machine with a locally mocked S3 bucket)
  • DEV (app running locally connecting to a remote S3 bucket with credentials managed locally)
  • AWS (app running on an AWS resource with credentials managed externally, i.e. role attached to resource)
  1. Set your bucket config as follows.
item(name = "S3_BUCKET_NAME", value = "<bucketName>")
item(name = "S3_FOLDER_PREFIX", value = "<folderPrefix>")
  1. Set the threshold for multiple-part uploads.

This step is optional. For handling large files, you can set a threshold in bytes; any file larger than the threshold be will uploaded in multiple parts by the AWS Storage Manager. By default, the threshold is 5MiB. To override this, specify the file size in bytes as an integer:

item(name = "S3_MULTIPART_SIZE_BYTES", value = <partSizeBytes>)
tip

AWS has a minimum part size of 5MiB. Therefore, setting this configuration to lower than 5MiB and uploading a file smaller than 5MiB but greater than the configured size will fail.

See Amazon S3 multipart upload limits for more details.

  1. Set the individual config for your chosen storage mode.

S3_STORAGE_MODE = LOCAL

item(name = "AWS_HOST", value = "<host>")
item(name = "AWS_REGION", value = "<region>")

S3_STORAGE_MODE = DEV

item(name = "AWS_REGION", value = "<region>")
item(name = "AWS_ACCESS_KEY", value = "<accessKey>")
item(name = "AWS_SECRET_ACCESS_KEY", value = "<secretAccessKey>")

S3_STORAGE_MODE = AWS

No extra config is required. The AWS resource your app is running on automatically extracts the required config from the environment.

Sharepoint

When using Sharepoint as your storage solution, you must have a Sharepoint instance created either on-premises or remotely. Next you will need to set the following specific config.

On-premises Sharepoint

item(name = "SHAREPOINT_ROOT_URL", value = "<rootUrl>")
item(name = "SHAREPOINT_SITE_URL", value = "<siteUrl>")
item(name = "SHAREPOINT_FOLDER", value = "<folder>")
item(name = "SHAREPOINT_CLIENT_ID", value = "<clientId>")
item(name = "SHAREPOINT_CLIENT_SECRET", value = "<clientSecret>")
item(name = "SHAREPOINT_TENANT_ID", value = "<tenantId>")

Remote Sharepoint

item(name = "SHAREPOINT_TENANT_ID", value = "<tenantId>")
item(name = "SHAREPOINT_SITE_ID", value = "<siteId>")
item(name = "SHAREPOINT_CLIENT_ID", value = "<clientId>")
item(name = "SHAREPOINT_CLIENT_SECRET", value = "<clientSecret>")