/install browser-file-uploa
Browser File Upload
Automates file uploads to web pages using agent-browser CLI.
Quick Start
Upload a file to a web page:
# Basic upload (auto-detects file input)
agent-browser open \x3Curl>
agent-browser find text 选择文件 click
agent-browser upload "#filePicker" \x3Cfile-path>
# Or use the Python script
python scripts/upload_file.py \x3Curl> \x3Cfile-path>
Usage Patterns
Upload to Specific Selector
When you know the file input selector:
agent-browser open https://example.com/upload
agent-browser click "#fileInput"
agent-browser upload "#fileInput" C:\path o\file.xlsx
Upload by Text Search
When file input has visible label text:
agent-browser open https://example.com/upload
agent-browser find text "上传文件" click
agent-browser upload "[type=file]" C:\path o\file.xlsx
Using Python Script
For reusable upload logic with flexible path specification:
python scripts/upload_file.py \x3Curl> \x3Cfile-path> [selector] [wait_ms]
Arguments:
url- Target page URLfile-path- Path to file (supports multiple formats, see below)selector- Optional CSS selector for file inputwait_ms- Optional wait time after page load (default: 2000)
File Path Formats
The Python script supports multiple path formats:
| Format | Example | Description |
|---|---|---|
| Absolute | `C:\Users\ | |
| ame\file.xlsx` | Full path | |
| Relative | ./data/file.xlsx |
Relative to current directory |
| Workspace | workspace/file.xlsx |
Relative to OPENCLAW_WORKSPACE |
| Env Var | ${HOME}/file.xlsx |
Environment variable |
| Windows Env | %USERPROFILE%\file.xlsx |
Windows environment variable |
Path Examples
# Absolute path
python scripts/upload_file.py https://example.com C:\Users\陈\Documents\data.xlsx
# Relative path (from workspace)
python scripts/upload_file.py https://example.com ./test.xlsx
# Workspace-relative
python scripts/upload_file.py https://example.com workspace/data/test.xlsx
# With environment variable
python scripts/upload_file.py https://example.com ${HOME}/downloads/file.xlsx
Common Selectors
| Selector | Description |
|---|---|
#filePicker |
Common id for file inputs |
[type=file] |
Any file input element |
input[type=file] |
Explicit file input |
.upload-zone |
Drop zone containers |
Troubleshooting
File input not found:
- Run
agent-browser snapshotto inspect page elements - Look for
[type=file]or file-related buttons - Try clicking the upload zone first
Upload fails:
- Ensure file path is absolute
- Check file exists:
test-path \x3Cfile-path> - Try
agent-browser find text 选择文件 clickfirst
Page not loaded:
- Add
agent-browser wait 2000after open - Use
agent-browser wait --load networkidlefor slow pages
Related Commands
# Inspect page elements
agent-browser snapshot
# Take screenshot
agent-browser screenshot
# Find elements by text
agent-browser find text "上传"
# Click element
agent-browser click \x3Cselector>
# Upload file
agent-browser upload \x3Cselector> \x3Cfile-path>
Example: Upload Excel to UU Tool
# Method 1: Direct agent-browser commands
agent-browser open https://uutool.cn/excel/
agent-browser wait 2000
agent-browser find text 选择文件 click
agent-browser upload "#filePicker" C:\Users\陈\.openclaw\workspace est.xlsx
# Method 2: Using Python script with absolute path
python scripts/upload_file.py https://uutool.cn/excel/ C:\Users\陈\.openclaw\workspace est.xlsx
# Method 3: Using Python script with workspace-relative path
python scripts/upload_file.py https://uutool.cn/excel/ workspace/test.xlsx
# Method 4: Using Python script with custom selector and wait time
python scripts/upload_file.py https://uutool.cn/excel/ workspace/test.xlsx "#filePicker" 3000
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install browser-file-uploa - After installation, invoke the skill by name or use
/browser-file-uploa - Provide required inputs per the skill's parameter spec and get structured output
What is browser-file-uploa?
Automates file uploads on web pages via agent-browser CLI or Python script, supporting flexible file paths and optional file input selectors. It is an AI Agent Skill for Claude Code / OpenClaw, with 94 downloads so far.
How do I install browser-file-uploa?
Run "/install browser-file-uploa" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is browser-file-uploa free?
Yes, browser-file-uploa is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does browser-file-uploa support?
browser-file-uploa is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created browser-file-uploa?
It is built and maintained by weixizi (@weixizi); the current version is v1.0.0.