Skip to content

best-referenced/strapi-provider-upload-cos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

strapi-provider-upload-cos

参数

参数名 类型 是否必填 默认值 描述
SecretId string T - 用户的 SecretId
SecretKey string T - 用户的 SecretKey,建议只在前端调试时使用,避免暴露密钥
Region string T - 存储桶所在地域,枚举值请参见 地域和访问域名
Bucket string T - 存储桶的名称,命名规则为 BucketName-APPID,此处填写的存储桶名称必须为此格式
BasePath string F / 默认上传的文件夹路径
BaseOrigin string F http://{Bucket}.cos.{Region}.myqcloud.com 可填入 CDN 根路径

示例

./config/plugins.js

module.exports = ({ env }) => ({
  // ...
  upload: {
    provider: "cos",
    providerOptions: {
      SecretId: env('COS_SECRET_ID'),
      SecretKey: env('COS_SECRET_KEY'),
      Region: env('COS_REGION'),
      Bucket: env('COS_BUCKET'),
      BasePath: '/project-dir',
      BaseOrigin: 'https://cdn.domain.com',
    }
  },
  // ...
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%