browser_upload_file
Summary: Browser Upload File
POST /api/execute/browser_upload_fileAttaches one or more local filesystem files to an HTML file input control, bypassing the native OS file picker dialog. The target locator—supporting OwlMark tokens, CSS queries, pixel coordinates, or natural-language phrases—can reference either an input[type=file] node directly or a styled button wrapper that delegates to one. Once the underlying file input is resolved, the backend verifies that every specified file path exists on disk (or stages multipart uploads into temporary paths) and populates the element's internal FileList object. Blink then dispatches synthetic input and change events so client-side upload scripts, image previewers, and Dropzone handlers process the attached files immediately.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| context_id | string | yes | Workspace handle where the file attachment operation will take place. |
| selector | string | yes | File input or trigger button via OwlMark token, CSS locator, coordinates, or description. |
| file_paths | string | yes | Array or JSON-encoded list of absolute server filesystem paths to attach. |
Usage
result = await browser.upload_file(context_id=context_id, selector="#element-id", file_paths="value")