Upload File
upload_fileSet files on a web page's file input as if chosen in the file picker. Provide absolute paths; works with hidden inputs and triggers change events.
Instructions
Set the files of an , as if chosen in the file picker. Paths must be absolute and point at existing regular files; anything else is refused, as are credential, shell-history, mail and browser-profile files (~/.ssh, ~/.aws, Arc and Chrome profiles, Messages, Mail, Safari, Keychains, .env and .env.*, .zsh_history, and similar), whatever the letter case of the path. The page receives its normal input and change events. Needs the DevTools engine. Many sites hide the real input behind a button: select the hidden input element itself.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nth | No | Which match to act on when several exist, 0-based | |
| exact | No | For "text=", "label=" and "placeholder=" selectors, require the whole trimmed text to equal the label. No effect on CSS, ref= or role= selectors. | |
| paths | Yes | Absolute paths of the files to attach | |
| tab_id | No | Arc tab id from list_tabs. Omit to use this agent's current tab. A tool that changes a tab will not fall back to the tab the user is looking at, so pass this or call open_url first. | |
| selector | Yes | The file input: a CSS selector such as input[type=file], "text=Label", or ref=, role=, label=, placeholder= as in click. |