Overview

Introduction

Storage engines are used to save files to specific services, including local storage (saved to the server's hard drive), cloud storage, etc.

Before uploading any files, you need to configure a storage engine. The system automatically adds a local storage engine during installation, which can be used directly. You can also add new engines or edit the parameters of existing ones.

Storage Engine Types

Currently, NocoBase has built-in support for the following engine types:

The system automatically adds a local storage engine during installation, which can be used directly. You can also add new engines or edit the parameters of existing ones.

If you are already using a storage engine that only supports public access and want to migrate historical files to S3 Pro, see Migrate to S3 Pro.

File Accessibility

Different storage engines support different file access controls. Before configuring a storage engine, confirm whether your files need private access:

Storage engineFile accessibility
Local StorageOnly public access is supported; private access is not supported
Amazon S3Only public access is supported; private access is not supported
Aliyun OSSOnly public access is supported; private access is not supported
Tencent COSOnly public access is supported; private access is not supported
S3 ProPrivate access is supported through temporary signed URLs
Note

Local Storage, Amazon S3, Aliyun OSS, and Tencent COS do not perform login authentication for file access and do not generate temporary signed URLs. After a file is uploaded, anyone who has the file access URL can access it directly.

If you need to store contracts, identity documents, internal materials, or other files that should not be public, use S3 Pro and enable private access.

Common Parameters

In addition to the specific parameters for different engine types, the following are common parameters (using local storage as an example):

Example of file storage engine configuration

Title

The name of the storage engine, for human identification.

System Name

The system name of the storage engine, used for system identification. It must be unique within the system. If left blank, the system will automatically generate a random one.

Public URL prefix

The prefix part of the publicly accessible URL for the file. It can be the base URL of a CDN, such as: "https://cdn.nocobase.com/app" (no trailing "/").

Path

The relative path used when storing files. This part will also be automatically appended to the final URL during access. For example: "user/avatar" (no leading or trailing "/").

File size limit

The size limit for files uploaded to this storage engine. Files exceeding this size cannot be uploaded. The system default limit is 20MB, and it can be adjusted up to a maximum of 1GB.

File types

You can restrict the types of files that can be uploaded, using the MIME syntax. For example: image/* represents image files. Multiple types can be separated by commas, such as: image/*, application/pdf which allows image and PDF files.

Default storage engine

When checked, this is set as the system's default storage engine. When an attachment field or file collection does not specify a storage engine, uploaded files will be saved to the default storage engine. The default storage engine cannot be deleted.

Keep file when record is deleted

When checked, the uploaded file in the storage engine will be kept even when the data record in the attachment or file collection is deleted. By default, this is not checked, meaning the file in the storage engine will be deleted along with the record.

Tip

After a file is uploaded, the final access path is constructed by concatenating several parts:

<Public URL prefix>/<Path>/<Filename><Extension>

For example: https://cdn.nocobase.com/app/user/avatar/20240529115151.png.