file-upload

file-upload is a skill for Claude Code, Codex from nongjun/feishu-cursor-claw. It costs 34 tokens per session (438 once invoked), scanned A, original, MIT.

A shared file-upload service that saves files, checks their real type, cleans filenames, and can create image thumbnails. It accepts common image, video, and office-document formats.

In plain words
What is it for?
Use it to add file uploads, secure filename handling, file-type validation, storage, deletion, and optional image thumbnails.
Why use it?
It handles common upload safety and storage tasks centrally, including preventing misleading file extensions and unsafe path names.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to add file uploads, secure filename handling, file-type validation, storage, deletion, and optional image thumbnails.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nongjun/feishu-cursor-claw/file-upload
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nongjun/feishu-cursor-claw --skill file-upload
Clone the repo
git clone --depth 1 https://github.com/nongjun/feishu-cursor-claw

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for file-upload

README.md
[![agentmods](https://agentmods.dev/badge/skills/nongjun/feishu-cursor-claw/file-upload.svg)](https://agentmods.dev/skills/nongjun/feishu-cursor-claw/file-upload)
Your own site
<a href="https://agentmods.dev/skills/nongjun/feishu-cursor-claw/file-upload"><img src="https://agentmods.dev/badge/skills/nongjun/feishu-cursor-claw/file-upload.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 438 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00034 $0.00438
Opus 5 $0.00017 $0.00219
Sonnet 5 $0.00007 $0.00088
Haiku 4.5 $0.00003 $0.00044

Measured 8d ago against content hash 8fbc03fcb8b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

file-upload scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

参考代码/njcursor/skills/file-upload/SKILL.md · 50 lines

What it actually says

文件上传服务

关键方法(FileService)

方法 用途
save_file(file, subdir, max_size) 保存上传文件(自动重命名)
generate_thumbnail(file_path, max_size) 生成缩略图(需 PIL)
delete_file(file_path) 安全删除文件
get_file_type(filename) 根据 MIME 和扩展名判断类型

安全验证工具(upload_utils)

函数 用途
validate_file_type(file) Magic Number 验证(防伪造扩展名)
sanitize_filename(filename) 文件名清理(防路径遍历)

支持的文件类型

类型 扩展名
图片 jpg, jpeg, png, gif, bmp, webp
视频 mp4, avi, mov, wmv, flv, mkv
文档 pdf, doc, docx, xls, xlsx, ppt

SOP:集成文件上传

  1. 后端通过公共路由自动注册:create_common_router(upload_dir="/app/uploads")
  2. 上传端点:POST /api/{module}/common/upload
  3. 如需定制,直接实例化 FileService(upload_dir=...)
  4. 缩略图生成依赖 Pillow(可选安装)

重点关注

  • 文件名自动生成:时间戳 + UUID,避免冲突
  • 上传目录需在 Docker 中挂载卷持久化
  • 部分模块(如内容中心)有独立 FileService 实现

参考文件

  • 公共模块/shared_backend/services/file_service.py
  • 公共模块/shared_backend/utils/upload_utils.py
  • 公共模块/shared_backend/api/common.py(/upload 路由)
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 50 lines · 34 tokens per session scan A 8fbc03fcb8b0

Subscribe to this mod's changes

file-upload is a skill published in the GitHub repository nongjun/feishu-cursor-claw (14 stars, last pushed 1mo ago), licensed MIT. It adds 34 tokens to every session and 438 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.