safari_upload_file
Uploads a local file directly into a web page's file input using a CSS selector and absolute path, without opening a file dialog or clicking the input.
Instructions
Upload a file to a element via JavaScript DataTransfer — NO file dialog, NO UI interaction. IMPORTANT: Do NOT click the file input before calling this tool — just provide the selector and file path. If a file dialog is already open, this tool will close it first. NOTE: 'verified 0 files' may appear even on success if the site uses a custom upload handler — check visually with safari_snapshot. For an IMAGE going into a composer/editor that should show a thumbnail, pass verifyPreview:true — some sites (Google Business Profile) accept the file handle and flip their UI to 'attached' while ingesting nothing, and the post then publishes with no image.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| receipt | No | Tab receipt from safari_new_tab — pins this call to that tab (survives reconnects/subagents) | |
| filePath | Yes | Absolute path to the file to upload | |
| selector | Yes | CSS selector of the file input | |
| forceNative | No | Skip synthetic injection and go straight to the real OS file dialog (isTrusted). Needs an unlocked screen and briefly focuses Safari. Use when the site is known to reject synthetic uploads. | |
| verifyPreview | No | Require a visible preview (blob:/data: image) to appear; if none does, the synthetic pickup was a ghost and this escalates to a real OS file dialog. Use for images going into a composer. |