mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
10 lines
391 B
Markdown
10 lines
391 B
Markdown
|
# 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`](https://pptr.dev/api/puppeteer.elementhandle.uploadfile/).
|
||
|
|
||
|
```ts
|
||
|
const fileElement = await page.waitForSelector('input[type=file]');
|
||
|
await fileElement.uploadFile(['./path-to-local-file']);
|
||
|
```
|