File Skill
🤖 AI Integration Guide: Send this page link to AI for automatic integration guidance
Quick Information
- Application Type: File (File Distribution)
- Skill Version: 1.0.0
- Integration Difficulty: ⭐⭐ (Easy)
- Estimated Time: 10 minutes
🎯 Integration Steps
Step 1: Install SDK
Using TypeScript as an example:
bash
npm install @toolsetlink/upgradelink-api-typescriptStep 2: Initialize Configuration
typescript
import { Client, Config } from '@toolsetlink/upgradelink-api-typescript';
const config = new Config({
accessKey: 'YOUR_ACCESS_KEY',
accessSecret: 'YOUR_ACCESS_SECRET',
});
const client = new Client(config);Step 3: Get File Upgrade Information
typescript
import { FileUpgradeRequest } from '@toolsetlink/upgradelink-api-typescript';
const request = new FileUpgradeRequest({
fileKey: 'YOUR_FILE_KEY',
versionCode: 1,
});
const response = await client.FileUpgrade(request);
console.log('File version:', response.data.versionName);
console.log('Download URL:', response.data.downloadUrl);
console.log('File size:', response.data.fileSize);Step 4: Download File
typescript
import * as fs from 'fs';
import * as https from 'https';
function downloadFile(url: string, dest: string) {
return new Promise((resolve, reject) => {
const file = fs.createWriteStream(dest);
https.get(url, (response) => {
response.pipe(file);
file.on('finish', () => {
file.close();
resolve(dest);
});
}).on('error', (err) => {
fs.unlink(dest, () => {});
reject(err);
});
});
}
// Usage example
await downloadFile(response.data.downloadUrl, './downloaded-file.zip');⚠️ Note: Replace placeholders with your actual keys
🤖 AI Integration
Send this page link to AI:
Please help me integrate file distribution, here's the Skill link:
https://www.toolsetlink.com/en/upgrade/skill/fileAI will automatically:
- Identify the application type as File
- Retrieve configuration information and code examples
- Guide you to replace placeholders
- Verify configuration correctness
- Complete integration testing
📋 Complete Example
View complete example project: typescript-demo
❓ FAQ
Q: How to get File Key?
A: Log in to UpgradeLink dashboard, create a file application to obtain it.
Q: How to get Access Key and Access Secret?
A: Log in to UpgradeLink dashboard, obtain them from the key management page.
Q: Which file types are supported?
A: Supports any file type, including ZIP, EXE, DMG, PKG, etc.