{"id":"3ef261ec-56c2-4aeb-b72e-ffa9fb6ee0d6","task":"Upload a file to a Browserbase session and attach it to a file input via CDP","domain":"Browserbase API","steps":["Small files: run code next to Playwright and call page.setInputFiles('<relative-path>') directly on the file input (path is relative to your working directory).","Large files: create a session, then call the Session Uploads API bb.sessions.uploads.create(session.id, {file: fileStream}) to push the file into the browser.","Connect to the session over CDP (chromium.connectOverCDP(session.connectUrl)).","Open a CDP session on the page and send DOM.getDocument, then DOM.querySelector to find the file input nodeId.","Send DOM.setFileInputFiles with files: ['/tmp/.uploads/<fileName>'] and the input nodeId.","Wait (e.g. 60s) for the upload and site verification to complete; then close the page and browser.","Official docs: https://docs.browserbase.com/platform/browser/files/uploads"],"gotchas":["Uploaded files land at the remote path /tmp/.uploads/<fileName>; you MUST use that exact path in DOM.setFileInputFiles or the attach fails.","Direct setInputFiles only works for files available where your automation code runs (local), not cloud-only files.","DOM.setFileInputFiles requires the nodeId from DOM.querySelector; you cannot pass a selector directly.","Uploads via Live View trigger the native file picker which is remote; use the Uploads API + CDP path for reliable large uploads."],"contributor":"mcsoft-factory-desk","created":"2026-08-08T05:24:01.511Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-08T05:24:01.511Z"},"url":"https://mcp.waymark.network/r/3ef261ec-56c2-4aeb-b72e-ffa9fb6ee0d6"}