• 首页
  • 产品中心
    • 数式Oinone四大产品

      低代码开发平台无代码开发平台集成开发平台AI大模型开发
    • 数式Oinone体系能力

      用户与组织权限管理文件管理消息中心国际化业务审计
    • 数式Oinone核心产品特性

      低无一体面向软件公司场景无限制应用级扩容可分可合
  • 服务中心
    • 客户服务

      预约演示方案咨询私有部署找人定制
    • 开发者

      问答下载
    • Oinone学院

      社区学习

    《精讲面向软件公司的低代码平台——以Oinone为例》

  • 合作伙伴
    渠道申请伙伴名录专家库
  • 关于数式
0571-88757863

File Storage:OSS (CDN) Configuration and File System Operations


Ⅰ、OSS Types Supported by Oinone

TypeService
OSSAlibaba Cloud OSS
UPYUNUpyun
MINIOMinIO
HUAWEI_OBSHuawei Cloud OBS
LOCALLocal NGINX File Storage
TENCENT_COSTencent Cloud COS
CTYUN_ZOSTianyi Cloud ZOS

Ⅱ、OSS Universal YAML Configuration

cdn:
  oss:
    name: # Name
    type: # Type
    bucket:
    uploadUrl: # Upload URL
    downloadUrl: # Download URL
    accessKeyId:
    accessKeySecret:
    mainDir: # Main directory
    validTime: 3600000
    timeout: 600000
    active: true
    referer:
    localFolderUrl:
    others:
      [key]:
        name: # Name
        type: # Type
        bucket:
        uploadUrl: # Upload URL
        downloadUrl: # Download URL
        accessKeyId:
        accessKeySecret:
        mainDir: # Main directory
        validTime: 3600000
        timeout: 600000
        active: true
        referer:
        localFolderUrl:

Note:

In others, use a custom key to specify the OSS service for file upload/download functions. Upload/download configurations must match; otherwise, the functions cannot be used normally.

Ⅲ、OSS Configuration Examples

(Ⅰ)Alibaba Cloud OSS

cdn:
  oss:
    name: Alibaba Cloud
    type: OSS
    bucket: pamirs (modify according to actual situation)
    uploadUrl: oss-cn-hangzhou.aliyuncs.com
    downloadUrl: oss-cn-hangzhou.aliyuncs.com
    accessKeyId: Your accessKeyId
    accessKeySecret: Your accessKeySecret
    # Modify according to actual situation
    mainDir: upload/
    validTime: 3600000
    timeout: 600000
    active: true
    imageResizeParameter:
    referer:

(Ⅱ)Huawei Cloud OBS

cdn:
  oss:
    name: Huawei Cloud
    type: HUAWEI_OBS
    bucket: pamirs (modify according to actual situation)
    uploadUrl: obs.cn-east-2.myhuaweicloud.com
    downloadUrl: obs.cn-east-2.myhuaweicloud.com
    accessKeyId: Your accessKeyId
    accessKeySecret: Your accessKeySecret
    # Modify according to actual situation
    mainDir: upload/
    validTime: 3600000
    timeout: 600000
    active: true
    allowedOrigin: http://192.168.95.31:8888,https://xxxx.xxxxx.com
    referer:

Huawei Cloud OBS requires adding the following dependencies to the startup project:

<okhttp3.version>4.9.3</okhttp3.version>
<dependency>
    <groupId>com.squareup.okhttp3</groupId>
    <artifactId>okhttp</artifactId>
    <version>${okhttp3.version}</version>
</dependency>

Note:

For Huawei Cloud OBS anti-leech configuration, only requests with specific referers are allowed. However, when processing Excel imports anonymously in the backend, no referer is carried, resulting in rejection.

(Ⅲ)MINIO

File system, MinIO configuration:
cdn:
  oss:
    name: minio
    type: MINIO
    bucket: pamirs (modify according to actual situation)
    uploadUrl: http://192.168.243.6:32190 (modify according to actual situation)
    downloadUrl: http://192.168.243.6:9000 (modify according to actual situation)
    accessKeyId: Your accessKeyId
    accessKeySecret: Your accessKeySecret
    # Modify according to actual situation
    mainDir: upload/
    validTime: 3600000
    timeout: 600000
    active: true
    referer:
    localFolderUrl:

(Ⅳ)Upyun

cdn:
  oss:
    name: Upyun
    type: UPYUN
    bucket: pamirs (modify according to actual situation)
    uploadUrl: v0.api.upyun.com
    downloadUrl: v0.api.upyun.com
    accessKeyId: Your accessKeyId
    accessKeySecret: Your accessKeySecret
    # Modify according to actual situation
    mainDir: upload/
    validTime: 3600000
    timeout: 600000
    active: true
    referer:

(Ⅴ)Local File Storage

cdn:
  oss:
    name: Local File NG System
    type: LOCAL
    # uploadUrl is the Oinone backend service address and port
    uploadUrl: http://127.0.0.1:8091
    # downloadUrl is the frontend address, i.e., the path and port directly mapped to Nginx static resources
    downloadUrl: http://127.0.0.1:8081
    validTime: 3600000
    timeout: 600000
    active: true
    referer:
    # Local Nginx static resource directory
    localFolderUrl: /Users/wangxian/nginx/html/designer/static

(Ⅵ)Tencent Cloud COS

cdn:
  oss:
    name: TENCENT_COS
    type: TENCENT_COS
    bucket: cos-dcode-prod-1252296671
    uploadUrl: cos.ap-shanghai.myqcloud.com
    downloadUrl: cos.ap-shanghai.myqcloud.com
    accessKeyId: Your accessKeyId
    accessKeySecret: Your accessKeySecret
    mainDir: upload/demo/
    validTime: 3600000
    timeout: 600000
    active: true
    image-resize-parameter:
    allowedOrigin: https://test.oinone.com,http://127.0.0.1:88
    referer:

(VII) Telecom Cloud ZOS

cdn:
  oss:
    name: China Telecom Cloud
    type: CTYUN_ZOS
    bucket: pamirs (Modify according to the actual situation)
    uploadUrl: xxxx.zos.ctyun.cn
    downloadUrl:  xxxx.zos.ctyun.cn
    accessKeyId: Your accessKeyId
    accessKeySecret: Your accessKeySecret
    # Modify according to the actual situation
    mainDir: upload/
    validTime: 3600000
    timeout: 600000
    active: true
    # Modify according to the actual situation
    allowedOrigin: http://192.168.95.31:8888,https://xxxx.xxxxx.com
    referer:

The following dependencies need to be added when starting the project for China Telecom Cloud ZOS:

<okhttp3.version>4.9.3</okhttp3.version>
<dependency>
    <groupId>com.squareup.okhttp3</groupId>
    <artifactId>okhttp</artifactId>
    <version>${okhttp3.version}</version>
</dependency>

Note: For more YAML configurations, please refer to Module API.

Ⅳ、OSS Code Examples

To directly upload files to OSS in the background, obtain the file system client through FileClientFactory.getClient():

// Get the file client
// 1. Get the default file client
FileClient fileClient = FileClientFactory.getClient();
// 2. Get the file client by cdnKey (used in multi-CDN configurations)
FileClient fileClient = FileClientFactory.getClient(resourceFileForm.getCdnKey());

// Example 1
CdnFile cdnFile = FileClientFactory.getClient().upload(fileName, data/**byte[]*/);

// Example 2
String fileName = "pathname/" + file.getName();
FileClientFactory.getClient().uploadByFileName(fileName, is/**InputStream*/);

A complete example:

private static Map<String, String> uploadFiles(File unzipDirectory) {
    Map<String, String> result = new HashMap<>();
    File[] files = unzipDirectory.listFiles();
    if (files == null) {
        return result;
    }
    for (File file : files) {
        try (FileInputStream is = new FileInputStream(file)) {
            // The file name concatenation is just an example; modify it according to actual needs
            String fileName = "widgetFile/" + file.getName();
            FileClientFactory.getClient().uploadByFileName(fileName, is);
            String url = FileClientFactory.getClient().getDownloadUrl(fileName);
            result.put(file.getName(), url);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    return result;
}
Edit this page
Last Updated:2/28/26, 6:16 AM
Prev
File Storage:OSS Configuration for MINIO Without Public Network Access
Next
Permission Extension:How to Skip Permission Interception for Functions
默认页脚
Copyright © 2026 Mr.Hope