Coze Upload — 本地文件转临时媒体链接

SkillFiles & storage

Uploads local files to the cloud and returns accessible URLs. Supports images (png/jpg/webp/gif) and videos (mp4/webm/mov). Use this skill when the user needs to upload an image or video, convert a local file to a URL, get an image or video link, convert local images/videos to links, or mentions coz

Use Coze Upload — 本地文件转临时媒体链接 in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add Coze Upload — 本地文件转临时媒体链接 and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the Coze Upload skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Coze Upload — 本地文件转临时媒体链接Start free

What this skill tells your AI

The instructions your AI receives, as published by xuliang2024/video_skills in skills/coze-upload/SKILL.md and read by Ahel’s review.

将本地图片或视频上传到 Coze,返回可访问的临时 URL。

流程

本地文件 → ① 获取 Token → ② 上传到 Coze → ③ Workflow 转链接 → 媒体 URL
  1. GET https://api.xskill.ai/api/fal/tasks/coze_token(无需认证)→ upload_key + data
  2. POST https://api.coze.cn/v1/files/upload(Bearer = upload_key)→ file_id
  3. POST https://api.coze.cn/v1/workflow/run(Bearer = data, workflow_id = 7527555709244801087)→ 媒体 URL

脚本使用

脚本路径:.cursor/skills/coze-upload/scripts/coze_upload.py

无外部依赖,仅用 Python 标准库。

# 单个文件
python .cursor/skills/coze-upload/scripts/coze_upload.py /path/to/image.png

# 批量上传
python .cursor/skills/coze-upload/scripts/coze_upload.py a.png b.mp4 c.jpg

进度信息输出到 stderr,最终 URL 输出到 stdout,支持管道:

URL=$(python .cursor/skills/coze-upload/scripts/coze_upload.py /tmp/photo.jpg)
echo "媒体链接: $URL"

Python 调用

import subprocess, sys

def coze_upload(filepath: str) -> str:
    """上传本地文件,返回临时媒体链接。"""
    script = ".cursor/skills/coze-upload/scripts/coze_upload.py"
    result = subprocess.run([sys.executable, script, filepath], capture_output=True, text=True)
    if result.returncode != 0:
        raise RuntimeError(f"上传失败: {result.stderr}")
    return result.stdout.strip()

也可直接 import:

from scripts.coze_upload import upload

url = upload("/tmp/photo.jpg")

自动触发条件

当以下情况发生时,应自动使用此 skill:

  • AI 模型需要文件 URL,但用户提供了本地路径
  • 用户要求上传文件获取链接
  • 其他 skill 流程中需要将本地产物转为可访问 URL

注意事项

  • 返回的是临时链接,有时效性
  • 支持图片和视频文件
  • 无需 API Key 或任何认证配置

Signals

GitHub stars
60
Forks
15
Last commit
Feb 2026
Advanced
Item type
skill
Key
coze-upload
Source
github.com/xuliang2024/video_skills