当前位置: 首页 > Skill >

Drop Files

Drop Files

0.1.1 2026.11.13 浏览:729
获取Skill文件查看使用说明
作者:苏舟许可证:
本文目录展开

DropFiles

Upload generated HTML or Markdown content to the DropFiles service and return a public shareable link. The service is free, globally accessible, and hosted on Cloudflare's edge network.

When to Invoke

Invoke this skill when the user wants to:

  • Share generated HTML or Markdown content via a public link
  • Publish a document, report, or page and get a URL to distribute
  • Upload any text-based artifact (HTML/Markdown) for online viewing
  • Generate a shareable preview link for content the agent just produced

API Endpoint

  • Base URL: https://dropfiles.tokendealhub.com
  • Upload: POST /api/v1/upload
  • Metadata: GET /api/v1/info/{id}
  • Preview: https://dropfiles.tokendealhub.com/v/{id}

Upload Request

IMPORTANT: Always use curl to send the upload request. The API is behind Cloudflare WAF which may block requests from other HTTP clients (e.g. Python urllib, Node fetch) with HTTP 403 (error code 1010). curl is the only reliably working client.

Send a POST request to https://dropfiles.tokendealhub.com/api/v1/upload with Content-Type: application/json.

Handling Large Content

When the content to upload is large (e.g. over 2KB) or contains special characters (quotes, backslashes, HTML tags, etc.), do NOT inline the content in a shell command. Instead, write the JSON payload to a temporary file first, then use curl -d @file:

# Step 1: Write JSON payload to a temp file (use Python or any method)
python3 -c "
import json
payload = json.dumps({
    'content': open('your_file.md').read(),
    'type': 'markdown',
    'expire': '7d',
    'title': 'My Document'
})
with open('/tmp/dropfiles_payload.json', 'w') as f:
    f.write(payload)
"

# Step 2: Upload using curl with file reference
curl -X POST https://dropfiles.tokendealhub.com/api/v1/upload 
  -H "Content-Type: application/json" 
  -d @/tmp/dropfiles_payload.json

# Step 3: Clean up
rm /tmp/dropfiles_payload.json

Request Body

Field Type Required Description
content string Yes The HTML or Markdown text to upload. Max 5MB.
type string No html, markdown, or auto (default: auto, auto-detects from content).
expire string No 1h, 1d, 7d, or 30d (default: 7d).
title string No Optional title shown on the share page.
password string No Optional password to protect the share page. See Password Policy below.
lang string No en, zh, or auto (default: auto).

Example (no password — default)

curl -X POST https://dropfiles.tokendealhub.com/api/v1/upload 
  -H "Content-Type: application/json" 
  -d '{
    "content": "# Hello WorldnnThis is a shared Markdown document.",
    "type": "markdown",
    "expire": "7d",
    "title": "My Document"
  }'

Example (with user-supplied password)

curl -X POST https://dropfiles.tokendealhub.com/api/v1/upload 
  -H "Content-Type: application/json" 
  -d '{
    "content": "# Secret ReportnnConfidential content.",
    "type": "markdown",
    "expire": "1d",
    "password": "user_provided_password"
  }'

Example (with skill-generated 6-digit password)

curl -X POST https://dropfiles.tokendealhub.com/api/v1/upload 
  -H "Content-Type: application/json" 
  -d '{
    "content": "# Protected DocumentnnContent here.",
    "type": "markdown",
    "expire": "7d",
    "password": "482917"
  }'

Password Policy

The default behavior is no password — the share link is publicly accessible by anyone with the URL.

Password protection is opt-in and supports three modes:

  1. No password (default): Omit the password field entirely, or send null. The share page is publicly readable.
  2. User-supplied password: If the user explicitly provides a password, pass it in the password field. The share page will prompt viewers for this password.
  3. Skill-generated 6-digit password: If the user asks for password protection but does not provide a password, the skill MUST generate a random 6-digit numeric code (e.g. "482917") and include it in the password field. The generated password must be clearly communicated back to the user so they can share it with intended viewers.

6-Digit Password Generation Rule

  • Exactly 6 digits, each 0–9 (e.g. 0-9 repeated 6 times, random).
  • Format: a string of 6 numeric characters, e.g. "482917".
  • Do NOT use letters, symbols, or shorter/longer lengths.
  • Always display the generated password to the user in the response, e.g.: Generated password: 482917. The user needs this to share with viewers.

Response

Success (HTTP 201)

{
  "success": true,
  "data": {
    "id": "abc123def456",
    "url": "https://dropfiles.tokendealhub.com/v/abc123def456",
    "preview_url": "https://dropfiles.tokendealhub.com/v/abc123def456?preview=1",
    "expire_at": "2026-07-22T10:30:00.000Z",
    "type": "markdown",
    "size": 42
  }
}

Error (HTTP 400/404/429/500)

{
  "success": false,
  "error": {
    "code": "CONTENT_REQUIRED",
    "message": "Content is required"
  }
}

Common error codes:

  • CONTENT_REQUIRED — content field is empty.
  • CONTENT_TOO_LARGE — content exceeds 5MB.
  • INVALID_TYPE — type is not one of html, markdown, auto.
  • INVALID_EXPIRE — expire is not one of 1h, 1d, 7d, 30d.
  • RATE_LIMIT_EXCEEDED — too many requests from the same IP.

Workflow

  1. Confirm the content to upload (HTML or Markdown). If the user just generated a document/page, use that content directly.
  2. Determine options:
    • type: use auto unless the user specifies. Auto-detection treats content containing <html or <!doctype as HTML, otherwise Markdown.
    • expire: default 7d unless the user requests a different lifetime.
    • title: optional, set if the user provides one.
  3. Determine password:
    • Default: no password.
    • If the user explicitly provides a password, use it.
    • If the user asks for protection without providing a password, generate a random 6-digit numeric string and use it.
  4. Send the upload request using curl (see "Upload Request" section above).
    • For small content (< 2KB, no special characters): inline the JSON directly in the curl -d argument.
    • For large content or content with special characters: write the JSON payload to a temp file, then use curl -d @/tmp/dropfiles_payload.json. Clean up the temp file afterwards.
    • Do NOT use Python urllib, Node fetch, or other HTTP clients — they will be blocked by Cloudflare WAF (HTTP 403, error code 1010).
  5. On success, return the url (and preview_url if relevant) to the user. If a password was generated, prominently display it: Generated password: XXXXXX.
  6. On error, surface the error.message to the user and suggest fixes.

Content Type Auto-Detection

When type is auto (the default), the server detects the type:

  • Content containing <html or <!doctype (case-insensitive) → html
  • Everything else → markdown

HTML content is sanitized server-side (scripts are stripped) for safety. Markdown content is rendered to HTML with a GitHub-like stylesheet on the share page.

Limits

  • Max content size: 5 MB (measured as UTF-8 bytes).
  • Max expiry: 30 days.
  • Rate limiting applies per IP; if you hit RATE_LIMIT_EXCEEDED, wait and retry.

Notes

  • The share link is public (unless password-protected). Anyone with the URL can view the content.
  • Viewers do not need an account.
  • HTML content is sanitized: <script> tags and event handlers are removed.
  • Markdown supports standard GitHub-flavored Markdown including code blocks, tables, and images.
  • The preview_url adds ?preview=1 and is useful when embedding the link in a context that should not inflate the access counter on initial load.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • DropFiles
    • When to Invoke
    • API Endpoint
    • Upload Request
      • Handling Large Content
      • Request Body
      • Example (no password — default)
      • Example (with user-supplied password)
      • Example (with skill-generated 6-digit password)
    • Password Policy
      • 6-Digit Password Generation Rule
    • Response
      • Success (HTTP 201)
      • Error (HTTP 400/404/429/500)
    • Workflow
    • Content Type Auto-Detection
    • Limits
    • Notes
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期