# downloadFile

Download a file from the remote computer running Selenium node to local file system by using the [`downloadFile`](https://webdriver.io/docs/api/selenium#downloadFile) command.

info

Note that this command is only supported if you use a [Selenium Grid](https://www.selenium.dev/documentation/en/grid/) with Chrome, Edge or Firefox and have the `se:downloadsEnabled` flag set in the capabilities.

## Usage[​](#usage "Direct link to Usage")

```
await browser.downloadFile(fileName, targetDirectory)
```

## Parameters[​](#parameters "Direct link to Parameters")

| Name              | Type     | Details                           |
| ----------------- | -------- | --------------------------------- |
| `fileName`        | `string` | remote path to file               |
| `targetDirectory` | `string` | target location on local computer |
