← 返回
内容创作 Key 中文

Tencent Cloud Image Hosting (Upload files to get online URLs)

Upload files to Tencent Cloud COS (Cloud Object Storage). Use when the user needs to upload images, documents, or any files to Tencent Cloud COS. Supports en...
上传文件至腾讯云COS(对象存储)。当用户需要将图片、文档或任意文件上传到腾讯云COS时使用。支持多种文件类型及自定义存储路径。
parsonssss
内容创作 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 576
下载
💾 45
安装
1
版本
#latest

概述

COS Upload

Upload files to Tencent Cloud COS (腾讯云对象存储) with automatic URL generation.

Quick Start

Method 1: Using Environment Variables

Set these environment variables:

export TENCENT_SECRET_ID=your-secret-id
export TENCENT_SECRET_KEY=your-secret-key
export TENCENT_COS_BUCKET=your-bucket-name
export TENCENT_COS_REGION=ap-guangzhou
export TENCENT_COS_PATH=uploads/  # optional

Then upload:

node cos-upload.js /path/to/file.png

Method 2: Using Command Line Arguments

node cos-upload.js /path/to/file.png \
  --secret-id AKIDxxx \
  --secret-key xxx \
  --bucket my-bucket-1250000000 \
  --region ap-guangzhou \
  --path images/

Output

On successful upload, returns:

  • Direct URL: https://{bucket}.cos.{region}.myqcloud.com/{key}
  • Signed URL: Pre-signed URL with 24-hour expiration (for private buckets)
  • COS Key: The object key in the bucket

Configuration Priority

  1. Command line arguments (highest priority)
  2. Environment variables
  3. Default values

Environment Variables

VariableRequiredDescription
---------------------------------
TENCENT_SECRET_IDYesTencent Cloud API Secret ID
TENCENT_SECRET_KEYYesTencent Cloud API Secret Key
TENCENT_COS_BUCKETYesCOS bucket name (e.g., my-bucket-1250000000)
TENCENT_COS_REGIONYesCOS region (e.g., ap-guangzhou, ap-nanjing)
TENCENT_COS_PATHNoUpload path prefix (default: uploads/)

Command Line Options

OptionDescription
---------------------
--secret-idTencent Cloud API Secret ID
--secret-keyTencent Cloud API Secret Key
--bucketCOS bucket name
--regionCOS region
--pathUpload path prefix

Notes

  • Files are uploaded with auto-generated unique names: upload_{timestamp}_{random}.{ext}
  • Supports all file types (images, documents, videos, etc.)
  • Uses 5MB multipart upload threshold for large files
  • Automatically generates both direct and pre-signed URLs

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 15:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

multi-news-aggregator-via x402

parsonssss
x402 付费全球新闻聚合,支持按来源和时间过滤的搜索功能
★ 0 📥 306
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,224
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,518