/tencentcloudbase:cloud-storage-webfrom tencentcloudbase
Complete guide for CloudBase cloud storage using Web SDK (@cloudbase/js-sdk) - upload, download, temporary URLs, file management, and best practices.
Ships in tencentcloudbase. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill when building web applications that need to upload, download, or manage files using CloudBase cloud storage via the @cloudbase/js-sdk (Web SDK).
Use this skill for file storage operations in web applications when you need to:
Do NOT use for:
Initialize CloudBase SDK
Choose the right storage method
uploadFile - For uploading files from browser to cloud storagegetTempFileURL - For generating temporary download linksdeleteFile - For deleting files from storagedownloadFile - For downloading files to browserHandle CORS requirements
Follow file path rules
[0-9a-zA-Z], /, !, -, _, ., , *, Chinese characters/ for folder structure (e.g., folder/file.jpg)import cloudbase from "@cloudbase/js-sdk";
const app = cloudbase.init({
env: "your-env-id", // Replace with your CloudBase environment ID
});
Initialization rules:
app instance across your applicationconst result = await app.uploadFile({
cloudPath: "folder/filename.jpg", // File path in cloud storage
filePath: fileInput.files[0], // HTML file input element
});
// Result contains:
{
fileID: "cloud://env-id/folder/filename.jpg", // Unique file identifier
// ... other metadata
}
const result = await app.uploadFile({
cloudPath: "uploads/avatar.jpg",
filePath: selectedFile,
method: "put", // "post" or "put" (default: "put")
onUploadProgress: (progressEvent) => {
const percent = Math.round(
(progressEvent.loaded * 100) / progressEvent.total
);
console.log(`Upload progress: ${percent}%`);
// Update UI progress bar here
}
});
| Parameter | Type | Required | Description |
|---|---|---|---|
cloudPath | string | Yes | Absolute path with filename (e.g., "folder/file.jpg") |
filePath | File | Yes | HTML file input object |
method | "post" | "put" | No | Upload method (default: "put") |
onUploadProgress | function | No | Progress callback function |
[0-9a-zA-Z], /, !, -, _, ., , *, Chinese characters/ to create folder hierarchy"avatar.jpg""uploads/avatar.jpg""user/123/avatar.jpg"⚠️ IMPORTANT: To prevent CORS errors, add your domain to CloudBase console:
https://your-app.com, http://localhost:3000)const result = await app.getTempFileURL({
fileList: [
{
fileID: "cloud://env-id/folder/filename.jpg",
maxAge: 3600 // URL valid for 1 hour (seconds)
}
]
});
// Access the download URL
result.fileList.forEach(file => {
if (file.code === "SUCCESS") {
console.log("Download URL:", file.tempFileURL);
// Use this URL to download or display the file
}
});
const result = await app.getTempFileURL({
fileList: [
{
fileID: "cloud://env-id/image1.jpg",
maxAge: 7200 // 2 hours
},
{
fileID: "cloud://env-id/document.pdf",
maxAge: 86400 // 24 hours
}
]
});
| Parameter | Type | Required | Description |
|---|---|---|---|
fileList | Array | Yes | Array of file objects |
| Parameter | Type | Required | Description |
|---|---|---|---|
fileID | string | Yes | Cloud storage file ID |
maxAge | number | Yes | URL validity period in seconds |
{
code: "SUCCESS",
fileList: [
{
code: "SUCCESS",
fileID: "cloud://env-id/folder/filename.jpg",
tempFileURL: "https://temporary-download-url"
}
]
}
maxAge based on use case (1 hour to 24 hours)SUCCESS/ERROR codes in responseconst result = await app.deleteFile({
fileList: [
"cloud://env-id/folder/filename.jpg"
]
});
// Check deletion results
result.fileList.forEach(file => {
if (file.code === "SUCCESS") {
console.log("File deleted:", file.fileID);
} else {
console.error("Failed to delete:", file.fileID);
}
});
const result = await app.deleteFile({
fileList: [
"cloud://env-id/old-avatar.jpg",
"cloud://env-id/temp-upload.jpg",
"cloud://env-id/cache-file.dat"
]
});
| Parameter | Type | Required | Description |
|---|---|---|---|
fileList | Array | Yes | Array of file IDs to delete |
{
fileList: [
{
code: "SUCCESS",
fileID: "cloud://env-id/folder/filename.jpg"
}
]
}
const result = await app.downloadFile({
fileID: "cloud://env-id/folder/filename.jpg"
});
// File is downloaded to browser default download location
| Parameter | Type | Required | Description |
|---|---|---|---|
fileID | string | Yes | Cloud storage file ID |
{
// Success response (no specific data returned)
// File is downloaded to browser
}
getTempFileURL insteadAll storage operations should include proper error handling:
try {
const result = await app.uploadFile({
cloudPath: "uploads/file.jpg",
filePath: selectedFile
});
if (result.code) {
// Handle error
console.error("Upload failed:", result.message);
} else {
// Success
console.log("File uploaded:", result.fileID);
}
} catch (error) {
console.error("Storage operation failed:", error);
}
INVALID_PARAM - Invalid parametersPERMISSION_DENIED - Insufficient permissionsRESOURCE_NOT_FOUND - File not foundSYS_ERR - System erroruploads/, avatars/, documents/)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ulpi-io/plugin-marketplace --plugin tencentcloudbaseOther plugins' skills for the same job
24 skills in this plugin
/ai-model-nodejsUse this skill when developing Node.js backend services or CloudBase cloud functions (Express/Koa/NestJS, serverless, backend APIs) that need AI capabilities. Features text generation (generateText), streaming (streamText), AND image generation (generateImage) via @cloudbase/node-sdk ≥3.16.0. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended), DeepSeek (deepseek-v3.2 recommended), and hunyuan-image for images. This is the ONLY SDK that supports image generation. NOT for browser/Web apps (use ai-model-web) or WeChat Mini Program (use ai-model-wechat)./ai-model-webUse this skill when developing browser/Web applications (React/Vue/Angular, static websites, SPAs) that need AI capabilities. Features text generation (generateText) and streaming (streamText) via @cloudbase/js-sdk. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended) and DeepSeek (deepseek-v3.2 recommended). NOT for Node.js backend (use ai-model-nodejs), WeChat Mini Program (use ai-model-wechat), or image generation (Node SDK only)./ai-model-wechatUse this skill when developing WeChat Mini Programs (小程序, 企业微信小程序, wx.cloud-based apps) that need AI capabilities. Features text generation (generateText) and streaming (streamText) with callback support (onText, onEvent, onFinish) via wx.cloud.extend.AI. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended) and DeepSeek (deepseek-v3.2 recommended). API differs from JS/Node SDK - streamText requires data wrapper, generateText returns raw response. NOT for browser/Web apps (use ai-model-web), Node.js backend (use ai-model-nodejs), or image generation (not supported).