Tencent Cloud COS Plugin
A powerful Dify plugin providing seamless integration with Tencent Cloud Object Storage (COS). Enables direct file uploads to Tencent Cloud COS and efficient file retrieval using URLs, with rich configuration options.
Version Information
- Current Version: v0.0.3
- Release Date: 2025-12-21
- Last Updated: 2025-12-21
- Compatibility: Dify Plugin Framework
- Python Version: 3.12
Version History
- v0.0.3 (2025-12-21): Added batch file download and public file download capabilities
- v0.0.2 (2025-09-30): Added multi-file upload functionality with enhanced directory and filename options
- v0.0.1 (2025-09-30): Initial release with file upload and retrieval capabilities, support for multiple directory structures and filename modes
Quick Start
- Download the tencent_cos plugin from the Dify marketplace
- Configure Tencent Cloud COS authorization information
- After completing the above configuration, you can immediately use the plugin
Core Features
File Upload to COS
- Direct File Upload: Upload any file type directly to Tencent Cloud COS
- Flexible Directory Structure: Multiple storage directory organization options
- Flat structure (no_subdirectory)
- Hierarchical date structure (yyyy_mm_dd_hierarchy)
- Combined date structure (yyyy_mm_dd_combined)
- Filename Customization: Control how filenames are stored in COS
- Use original filename
- Append timestamp to original filename
- Source File Tracking: Automatically captures and returns the original filename
- Smart Extension Detection: Automatically determine file extensions based on content type
File Retrieval by URL
- Direct Content Access: Retrieve file content directly using COS URLs
- Cross-Region Support: Works with all Tencent Cloud COS regions worldwide
Batch File Download
- Multiple URLs Support: Download multiple files using a list of URLs separated by semicolons
- Progress Tracking: Real-time status updates for each file download
- Comprehensive Statistics: Summary of total files, successful downloads, and total size
Public File Download
- No Authentication Required: Download public files from any platform without API keys
- Universal Compatibility: Works with any publicly accessible file URL
- Smart Filename Detection: Automatically extracts filenames from URLs or headers
Technical Advantages
- Secure Authentication: Robust credential handling with support for HTTPS
- Efficient Storage Management: Intelligent file organization options
- Comprehensive Error Handling: Detailed error messages and status reporting
- Multiple File Type Support: Works with all common file formats
- Rich Parameter Configuration: Extensive options for customized workflows
- Source File Tracking: Preserves original filename information
Requirements
- Python 3.12
- Tencent Cloud COS account with valid SecretId and SecretKey credentials
- Dify Platform access
- Required Python packages (installed via requirements.txt)
Installation & Configuration
-
Install the required dependencies:
-
Configure the plugin in Dify with the following parameters:
- Region: Your Tencent Cloud COS region (e.g., ap-beijing)
- Bucket Name: Your COS bucket name
- SecretId: Your Tencent Cloud SecretId
- SecretKey: Your Tencent Cloud SecretKey
Usage
The plugin provides five powerful tools for interacting with Tencent Cloud COS:
1. Upload File to COS (upload_file)
Dedicated tool for uploading files to Tencent Cloud COS.
- Parameters:
- : The local file to upload (required)
- : First-level directory under the bucket (required)
- : Optional directory structure mode (default: )
- : Store directly in specified directory
- : Store in date-based hierarchical structure
- : Store in combined date directory
- : Optional custom filename for COS storage
- : Optional filename composition mode (default: )
- : Use original filename
- : Use original filename plus timestamp
2. Multi-Upload Files to COS (multi_upload_files)
Dedicated tool for uploading multiple files to Tencent Cloud COS.
- Parameters:
- : The local files to upload (required, maximum 10 files)
- : First-level directory under the bucket (required)
- : Optional directory structure mode (default: )
- : Store directly in specified directory
- : Store in date-based hierarchical structure
- : Store in combined date directory
- : Optional filename composition mode (default: )
- : Use original filename
- : Use original filename plus timestamp
3. Get File by URL (get_file_by_url)
Dedicated tool for retrieving files from Tencent Cloud COS using URLs.
- Parameters:
- : The URL of the file in Tencent Cloud COS
4. Batch Download Files by URLs (get_files_by_urls)
Dedicated tool for batch downloading multiple files from Tencent Cloud COS.
- Parameters:
- : Multiple URLs of files in Tencent Cloud COS, separated by semicolon (;)
5. Download Public File by URL (get_public_file_by_url)
Dedicated tool for downloading public files from any platform without authentication.
- Parameters:
- : The URL of the public file that can be accessed without authentication
Examples
Upload File
Batch Upload Files
Get File by URL
Notes
- Ensure your COS bucket has the correct permissions configured
- The plugin requires valid Tencent Cloud credentials with appropriate COS access permissions
- For very large files, consider using multipart upload functionality (not currently implemented)
Developer Information
- Author:
- Email: [email protected]
- License: MIT License
- Source Code:
- Support: Through Dify platform and GitHub Issues
Ready to seamlessly integrate with Tencent Cloud COS?