Communitygithub.com

YepAPI/skills

预签名URL上传、大文件分片上传、S3/R2/Supabase存储。

skills 是什么?

该技能用于实现高效、安全的文件上传功能,支持直接通过预签名URL上传到存储服务,避免代理服务器中转造成的性能瓶颈。对于大于5MB的文件,它会自动采用分片上传策略,将文件切分成多个部分并行上传,大幅提升传输速度。技能强调客户端与服务器双重验证:客户端可校验文件类型和大小,服务器会通过检查文件魔数(magic bytes)而非仅依赖扩展名来确保安全性。它还包含图片优化功能,在上传时自动调整尺寸(最大2048px)、转换为WebP格式并剥离EXIF信息。上传进度可通过 XMLHttpRequest 或 fetch API 配合 ReadableStream 实时追踪。支持的存储平台包括AWS S3、Cloudflare R2和Supabase Storage,并针对高安全场景提供病毒扫描能力。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/file-uploads

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

文件上传

规则

  • 使用预签名URL直接上传到存储服务 — 不要通过你的服务器代理
  • 大于5MB的文件使用分片上传 — 将文件切分成多个部分,并行上传
  • 客户端验证:文件类型、文件大小限制 — 服务器再次验证
  • 图片优化:上传时调整大小(最大2048px)、转换为WebP格式、剥离EXIF信息
  • 进度追踪:使用 XMLHttpRequest 或带有 ReadableStream 的 fetch 实现上传进度
  • 存储:S3、R2 (Cloudflare) 或 Supabase Storage — 预签名URL模式相同
  • 服务端文件类型验证:检查文件魔数(magic bytes),而不仅仅是文件扩展名
  • 高安全场景下对用户上传文件进行病毒扫描

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

相关技能