{"skill":{"slug":"tmpfiles-upload","displayName":"Tmpfiles Upload","summary":"Upload files (images, PDFs, documents) to tmpfiles.org and send download links via messaging platforms. Use when: (1) User asks to send screenshots/files via...","description":"---\nname: tmpfiles-upload\ndescription: |\n  Upload files (images, PDFs, documents) to tmpfiles.org and send download links via messaging platforms.\n  Use when: (1) User asks to send screenshots/files via Feishu/other platforms, (2) Direct file upload to messaging platform fails,\n  (3) User needs a temporary file sharing solution with auto-expiring links.\n---\n\n# tmpfiles.org File Upload\n\nUpload files to tmpfiles.org (temporary file hosting) and get a download link.\n\n## When to Use\n\n- Sending screenshots to Feishu when direct upload fails\n- Sharing files temporarily (links expire after ~1 hour)\n- Quick file sharing without authentication\n\n## Upload Script\n\n```python\nimport requests\n\ndef upload_to_tmpfiles(file_path):\n    \"\"\"Upload file to tmpfiles.org and return download URL\"\"\"\n    with open(file_path, 'rb') as f:\n        r = requests.post('https://tmpfiles.org/api/v1/upload', files={'file': f})\n        data = r.json()\n        if data.get('status') == 'success':\n            # Replace org/ with org/dl/ for direct download\n            return data['data']['url'].replace('org/', 'org/dl/')\n        raise Exception(f\"Upload failed: {data}\")\n```\n\n## Usage in OpenClaw\n\n### Step 1: Capture screenshot (if needed)\n```bash\n/usr/sbin/screencapture -x ~/Desktop/screenshot.png\n```\n\n### Step 2: Upload to tmpfiles.org\n```bash\npython3 -c \"\nimport requests\nwith open('/path/to/file.png', 'rb') as f:\n    r = requests.post('https://tmpfiles.org/api/v1/upload', files={'file': f})\n    d = r.json()\n    if d.get('status') == 'success':\n        print(d['data']['url'].replace('org/', 'org/dl/'))\n\"\n```\n\n### Step 3: Send link via message\n```json\n{\n  \"action\": \"send\",\n  \"channel\": \"feishu\",\n  \"message\": \"文件链接：https://tmpfiles.org/dl/xxx\",\n  \"target\": \"user_id\"\n}\n```\n\n## Notes\n\n- Links expire after ~1 hour\n- Max file size: ~100MB\n- Files are publicly accessible while active\n- Not suitable for sensitive/permanent storage\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":525,"installsAllTime":1,"installsCurrent":1,"stars":0,"versions":1},"createdAt":1773770267672,"updatedAt":1778491982228},"latestVersion":{"version":"1.0.0","createdAt":1773770267672,"changelog":"Initial release","license":"MIT-0"},"metadata":null,"owner":{"handle":"turbos7","userId":"s17ebcpq0czs3d2cy4hgm21ww1850e99","displayName":"Vesper","image":"https://avatars.githubusercontent.com/u/69713627?v=4"},"moderation":null}