-
Notifications
You must be signed in to change notification settings - Fork 0
upload_file
Attach a file to a file input.
| MCP tool | upload_file |
| HTTP | POST /browser/upload |
For anything you wrote yourself — JSON, CSV, YAML, markdown, plain text — put it straight in text and give it a filename. There is no need to encode it; the server writes the real file and sends it to the browser, which runs on another machine.
Use content (base64) only for binary, and path only for a file already on the server's filesystem. Pass exactly one of the three.
The page reads the file's type from the filename extension, so name it report.csv rather than report. If you give a name without an extension, mime_type is used to pick one.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
xpath |
string | yes | — | |
text |
string | no | — | |
filename |
string | no | — | |
mime_type |
string | no | — | |
content |
string | no | — | |
session_id |
string | yes over HTTP | — | The session_id returned by /browser/open. Required here. |
path |
string | no | — | |
url |
string | no | — | |
wait_timeout |
integer | no | 30 |
| Field | Type | Notes |
|---|---|---|
filename |
string | The name the page sees for the attached file. |
bytes |
integer | Size of the file that was sent. |
url |
string | Current URL after the action. |
title |
string | Page title after the action. |
Errors are 400 for a bad argument, 401 without a token, 500 when the Grid
refuses. Over MCP the same failures arrive as a tool error.
MCP
upload_file(xpath="…")
HTTP
curl -X POST $SELENIUM_FLOW/browser/upload \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"session_id": "…",
"xpath": "…"
}'The action pages are generated from openapi.yaml, which is itself generated from the live MCP tool schemas — so they describe the server that shipped, not the one someone remembered. Prose belongs in wiki-notes/<tool>.md in the repo.
selenium-flow · MIT
Start here
Lifecycle
Going places
Doing things
Getting things out