Upload local files to Feishu Drive and send as file messages to chats or users.
media parameter in message tool instead (no need for this skill)bash
python scripts/upload_to_feishu.py /path/to/file.csv oc_xxxxxx --type chat_id
bash
python scripts/upload_to_feishu.py /path/to/file.pdf ou_xxxxxx --type open_id
bash
python scripts/upload_to_feishu.py /path/to/file.zip user@example.com --type email
bash
export OPENCLAW_CHAT_ID=oc_xxxxxx
python scripts/upload_to_feishu.py /path/to/file.csv --env
~/.openclaw/openclaw.json (channels.feishu.appId/appSecret)file_keyfile_key to target chat/userArgumentRequiredDefaultDescriptionfile_pathYes-Absolute path to local filereceive_idYes*-Recipient ID (chat_id, open_id, user_id, or email)--typeNochat_idRecipient type: chat_id, open_id, user_id, email``--envNofalseGet receive_id from OPENCLAW_CHAT_ID env var
*Not required if --env is used
TypeExampleUse Casechat_id``oc_06a6b40e03e98e41c8aebcbed8b09871Group chats (default)open_id``ou_b0f83ea276761ab10ebb3f4f277453b8Individual user (recommended)user_id``123456Individual user (by user_id)email``user@example.comSend to email address
From Feishu message metadata:
json
{
"conversation_label": "oc_06a6b40e03e98e41c8aebcbed8b09871"
}
→ receive_id = oc_06a6b40e03e98e41c8aebcbed8b09871, type = chat_id
From sender info:
json
{
"sender_id": "ou_b0f83ea276761ab10ebb3f4f277453b8"
}
→ receive_id = ou_b0f83ea276761ab10ebb3f4f277453b8, type = open_id
requests library: pip install requestsopenclaw.jsonBot needs these permissions in Feishu Developer Console:
Required for file upload:
im:resource:upload - Upload files (preferred)im:resource - Read and upload filesRequired for sending messages:
im:message - Send messages to chatsim:resource:upload or im:resourceQuick link: https://open.feishu.cn/app/cli_a94a21db99385bd8/auth?q=im:resource:upload,im:resource
All file types supported by Feishu Drive:
CategoryExtensionsDocumentsPDF, DOC, DOCX, XLS, XLSX, PPT, PPTXImagesJPG, PNG, GIF, WEBPArchivesZIP, RAR, 7ZCode/TextTXT, MD, JSON, CSV, XML, PY, JSMediaMP3, MP4, WAV (auto-converted to OPUS)
Script handles:
bash
# Test with a small file to a group chat
python scripts/upload_to_feishu.py /tmp/test.txt oc_xxxxxx --type chat_id
# Test sending to yourself (find your open_id from message metadata)
python scripts/upload_to_feishu.py /tmp/test.pdf ou_xxxxxx --type open_id
im:resource:upload or im:resource permissionchat_id starts with oc_open_id starts with ou_user_id is numericemail must be valid email formatIf script fails, user can manually:
openclaw.json (local only)FeatureThis SkillMessage Tool mediaDocuments (PDF, CSV, etc.)✅ Supported❌ Not supportedImages✅ Supported✅ Supported (easier)Videos✅ Supported✅ Supported (easier)File size limit30MBVaries by platformComplexity2 API calls1 API call
Recommendation: Use media parameter for images/videos, use this skill for documents and other files.