Codex File Bridge logo

Codex File Bridge

A Codex skill for reliable, filename-aware file uploads across browser forms.

> [!NOTE] > Codex File Bridge is a community project. It is not an official OpenAI product. ## The problem File uploads are a surprisingly awkward boundary for browser automation. A page may expose an ordinary file input, hide it behind a custom button, require a native chooser, accept pasted files instead, or rename a file after receiving it. This creates several failure modes for an unattended Codex workflow: - A custom upload control never emits a usable file-chooser event. - A native operating-system picker requires manual interaction. - Clipboard paste transfers the bytes but loses the original filename. - The destination adds a UUID, timestamp, or another server-side name. - A single-file field needs to carry several related files. ## The solution Codex File Bridge chooses the strongest upload route the current page supports, verifies what the page actually received, and keeps filename handling explicit. | Route | Best for | Filename behavior | |---|---|---| | Browser file chooser | Ordinary inputs and custom buttons that open a chooser | Original basename is normally preserved | | Clipboard attachment paste | Paste-aware editors and drop areas | Site may replace the basename; the skill records the displayed mapping | | ZIP bundle fallback | Several files, single-file fields, or filename-sensitive bundles | Inner filenames and relative paths remain intact | | Clear stop and handoff | Custom widgets with no chooser event or paste path | Never claims an upload succeeded when it cannot verify one | The technical skill ID remains `browser-file-upload`; **Codex File Bridge** is its human-facing name. ## Features - Uploads regular local files through Codex Browser Use. - Works with visible inputs, hidden inputs triggered by ordinary buttons, and paste-aware custom controls. - Preserves original filenames through the preferred chooser flow. - Verifies visible attachment names, counts, sizes, previews, progress, and success messages when the page exposes them. - Detects sanitized `C:\\fakepath\\` selection values without confusing selection with server receipt. - Reports site-generated names and preserves a generated-to-original mapping when an appropriate notes field exists. - Creates safe ZIP bundles while preserving inner filenames and relative paths. - Keeps attaching, uploading, and submitting as three distinct states. - Follows Codex Browser's active confirmation rules without imposing an extra skill-specific approval gate. ## Installation ### Ask Codex to install it Give Codex this request: ```text Install the browser-file-upload skill from https://github.com/dev-newb/codex-file-bridge ``` The skill becomes available on the next Codex turn after installation. ### Install manually macOS or Linux: ```bash mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills" git clone https://github.com/dev-newb/codex-file-bridge.git \ "${CODEX_HOME:-$HOME/.codex}/skills/browser-file-upload" ``` Windows PowerShell: ```powershell $codexRoot = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $HOME ".codex" } New-Item -ItemType Directory -Force -Path (Join-Path $codexRoot "skills") | Out-Null git clone https://github.com/dev-newb/codex-file-bridge.git ` (Join-Path $codexRoot "skills\browser-file-upload") ``` If that destination already exists, update it with `git pull --ff-only` instead of cloning over it. ## Requirements - Codex with the Browser skill available. - A controllable in-app or extension browser tab at the destination page. - Local filesystem access to the files the user requested. - Python 3 only when the ZIP helper is needed. The user must authorize the exact files and destination. Uploading is an external transmission, and surrounding form submission occurs only when requested. ## Usage Invoke the skill explicitly or describe the upload naturally: ```text Use $browser-file-upload to attach /absolute/path/report.pdf to the open form. Stage it, but do not submit the form. ``` ```text Upload these three screenshots to the CMS image fields and submit after verifying every filename. ``` ```text Bundle the files under ./release into one ZIP, preserve their relative paths, and upload the archive to the import field. ``` ```text Attach these files to the editor. If the chooser does not work, use its paste-aware fallback and tell me any names the site changed. ``` ## How it works ### 1. Resolve the target The skill identifies the exact browser tab, upload field, destination, and local files. It checks visible type, count, and size restrictions before mutation. ### 2. Prefer the browser chooser For a standard upload, it starts waiting for the `filechooser` event before clicking the input or its visible trigger. It then supplies absolute paths through the chooser's `setFiles(...)` method. This is the most reliable route and normally preserves the original basename. ### 3. Verify observable state A successful method call is not treated as proof by itself. The skill checks the page for selected filenames, attachment cards, previews, progress, server confirmation, or another authoritative success signal. It reports these states separately: 1. Files selected by the input. 2. Files received by the site. 3. Surrounding form submitted. ### 4. Use clipboard paste when supported If a custom control does not emit a chooser event but visibly supports pasting files, the in-app browser clipboard can carry an attachment payload. The skill reads the resulting attachment label rather than assuming the original name survived. In the Codex in-app browser, automated paste uses `Control+v` on both Windows and macOS. It does not also send `Meta+v`, which could create a duplicate attachment. ### 5. Bundle files when ZIP is appropriate The included [`scripts/make_upload_zip.py`](scripts/make_upload_zip.py) helper: - Accepts regular files only. - Preserves safe inner filenames. - Preserves relative paths below an optional common root. - Rejects missing files, directories, unsafe member paths, and duplicate member names. - Refuses to overwrite an existing archive. The outer ZIP can still be renamed by a site, but its inner member names remain intact. The skill does not add an unwanted manifest attachment to ordinary forms; it writes a mapping into an appropriate notes field when one exists, or reports the mapping to the user. ## ZIP helper macOS or Linux example: ```bash upload_tmp="$(mktemp -d)" python3 scripts/make_upload_zip.py \ --output "$upload_tmp/upload-bundle.zip" \ --root "/path/to/data" \ "/path/to/data/one.txt" "/path/to/data/nested/two.pdf" ``` Windows PowerShell example: ```powershell $uploadTemp = Join-Path ([IO.Path]::GetTempPath()) ("browser-upload-" + [guid]::NewGuid()) New-Item -ItemType Directory -Path $uploadTemp | Out-Null py -3 scripts\make_upload_zip.py ` --output (Join-Path $uploadTemp "upload-bundle.zip") ` --root "C:\data" ` "C:\data\one.txt" "C:\data\nested\two.pdf" ``` The helper prints JSON containing the archive path, member names, and final byte size. ## Compatibility and verification The skill is designed for Codex Browser's in-app and extension surfaces. The current implementation has been verified in the Codex Desktop in-app browser on macOS. Public disposable tests performed on August 28, 2026: | Target | Result | |---|---| | [DLP Test HTTPS POST](https://dlptest.com/https-post/) | Custom chooser passed; exact basename and size displayed; server confirmed receipt and discard | | [The Internet File Uploader](https://the-internet.herokuapp.com/upload) | Selection and upload passed; basename preserved exactly | | [Expand Testing File Uploader](https://practice.expandtesting.com/upload) | Selection and upload passed; server added a timestamp prefix, which the skill detected | | [WebDriver University File Upload](https://webdriveruniversity.com/File-Upload/index.html) | Selection passed; its blocking JavaScript result dialog stalled Browser Use after submission | Use synthetic disposable files on public test sites. Do not upload private information to a third-party test endpoint. ## Limitations - The supported Browser locator API does not expose direct `locator.setInputFiles(...)` injection. - A custom widget that emits no chooser event and accepts no clipboard paste still requires manual selection or a future browser primitive. - The skill cannot force a server to keep a particular outer filename. - Clipboard attachment paste is site-specific and may change the basename. - ZIP is not appropriate when a field requires separate files, restricts types, or processes each source independently. - Native operating-system file pickers are not automated through screen coordinates. ## Project layout ```text . ├── SKILL.md Codex instructions and routing ├── agents/openai.yaml Display metadata and default prompt ├── logo.png Project and skill logo └── scripts/ └── make_upload_zip.py Safe filename-preserving ZIP helper ``` ## Related project For the ChatGPT composer-specific clipboard workflow, including its UUID filename manifest behavior, see [chatgpt-clipboard-upload](https://github.com/dev-newb/chatgpt-clipboard-upload).