Skip to content

flxxyz/strapi-provider-upload-tencent-cloud-cos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

strapi-provider-upload-tencent-cloud-cos

参数

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

示例

./config/plugins.js

module.exports = ({ env }) => ({
  // ...
  upload: {
    provider: env("UPLOAD_PROVIDER", "tencent-cloud-cos"),
    providerOptions: {
      SecretId: env("COS_SECRET_ID"),
      SecretKey: env("COS_SECRET_KEY"),
      Region: env("COS_REGION"),
      Bucket: env("COS_BUCKET"),
      BasePath: env("COS_BASE_PATH", "/"),
      BaseOrigin: env("COS_BASE_ORIGIN", "https://yourdomain.com"),
    },
  },
  // ...
});

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%