Back to Puppeteer

Files

website/versioned_docs/version-24.40.0/guides/files.md

19.2.2390 B
Original Source

Files

Currently, Puppeteer does not offer a way to handle file downloads in a programmatic way. For uploading files, you need to locate a file input element and call ElementHandle.uploadFile.

ts
const fileElement = await page.waitForSelector('input[type=file]');
await fileElement.uploadFile(['./path-to-local-file']);