Install
openclaw skills install feishu-send-mediaSend images, files, audio, video and other media to Feishu users or chats. Use when user asks to send, share, or transfer media files via Feishu direct message or group chat.
openclaw skills install feishu-send-mediaSend media files (images, documents, audio, video) directly to Feishu users or chats using the message tool.
Use the message tool with action: send and path parameter:
{
"action": "send",
"target": "ou_xxx", // user open_id or chat_id
"path": "/path/to/file.pdf"
}
Supported types:
.png, .jpg, .jpeg, .gif, .webp.doc, .docx, .pdf, .txt, .rtf.mp3, .wav, .m4a.mp4, .movParameters:
target: User open_id (e.g., ou_3ac66d1ad7b8c1xxxxxxxxxxxxxxs) or chat IDpath: Absolute path to local filefilename: Override display nameUse chat_id as target:
{
"action": "send",
"target": "oc_xxx", // group chat ID
"path": "/path/to/file.pdf"
}
For images to display inline in the message (not as attachments), use the image parameter with base64:
{
"action": "send",
"target": "ou_xxx",
"image": "data:image/png;base64,..."
}
Follow these steps exactly for maximum success rate:
# Extract filename from source path
filename=$(basename "/source/path/to/file.png")
# Copy to workspace (overwrite if exists)
cp -f "/source/path/to/file.png" "~/.openclaw/workspace/${filename}"
# Verify copy succeeded
if [ ! -f "~/.openclaw/workspace/${filename}" ]; then
echo "ERROR: File copy failed"
exit 1
fi
Why overwrite (-f): Ensures fresh copy every time, avoids stale file issues.
# Get absolute path
abs_path=$(cd ~/.openclaw/workspace && pwd)/${filename}
# Validate file exists and is readable
if [ ! -r "$abs_path" ]; then
echo "ERROR: File not readable: $abs_path"
exit 1
fi
# Log for debugging
echo "Sending: $abs_path"
{
"action": "send",
"target": "ou_xxx",
"path": "/Users/casia/.openclaw/workspace/filename.png"
}
Check tool response:
"messageId" field present"error" field presentIf Step 4 fails, automatically attempt fallbacks in order:
# Sometimes transient failure, retry
cp -f "/source/path/to/file.png" "~/.openclaw/workspace/${filename}"
# Resend
# Convert to base64
base64_string=$(base64 -i "$abs_path")
# Send as inline image
{
"action": "send",
"target": "ou_xxx",
"image": "data:image/png;base64,${base64_string}"
}
When to use: Path method fails, small images (<3MB), .png/.gif files
{
"action": "upload_file",
"doc_token": "xxx",
"file_path": "$abs_path"
}
Then send the returned file URL.
When to use: Files >20MB, persistent path failures
| Error | Cause | Solution |
|---|---|---|
| File not found | Wrong path | Verify source path exists |
| Permission denied | File permission issue | chmod 644 on file |
| Tool error | Feishu API issue | Retry → base64 → drive |
| Empty file | Zero-byte file | Check source before copying |
| File too large | >20MB | Use Feishu drive |
| Scenario | Primary Method | Fallback 1 | Fallback 2 |
|---|---|---|---|
| Small image (<3MB) | path | base64 | - |
| Large image (3-20MB) | path | base64 | drive |
| Document | path | drive | - |
| Audio/Video | path | drive | - |
| Very large (>20MB) | drive | - | - |