puppeteer/website/versioned_docs/version-22.8.1/guides/files.md
release-please[bot] 042d61030c
chore: release main (#12415)
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2024-05-13 08:49:32 +00:00

391 B

Files

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

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