> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# fileUpload

> Attach a file to the next file picker the page opens.

Resolves a local path, an HTTPS URL, or an `env` variable holding a previously
downloaded path, then primes Playwright's chooser so the next click that
triggers a file dialog uploads the file.

## Parameters

| Parameter | Type      | Required | Description                                                           |
| --------- | --------- | -------- | --------------------------------------------------------------------- |
| `path`    | `string`  | Yes      | Local path or HTTPS URL of the file.                                  |
| `name`    | `string`  | No       | Override the filename presented to the form.                          |
| `saveAs`  | `string`  | No       | Name of the variable to write this step's return value to.            |
| `retries` | `number`  | No       | Number of times to retry the step on failure before failing the test. |
| `skipped` | `boolean` | No       | Skip this step at execution time.                                     |

## Shorthand

Local path or URL as a single string.

```yaml theme={null}
- fileUpload: momentic.config.yaml
```

## Examples

```yaml theme={null}
- fileUpload: "{{ env.DOWNLOADED_FILE.downloadedFile }}"
```

```yaml theme={null}
- fileUpload: momentic.config.yaml
```

```yaml theme={null}
- fileUpload: https://static.wikia.nocookie.net/fridaynightfunking/images/b/b5/ASDFGuyIdle.gif
```

## Related

* [Upload files](/guides/page-interactions/upload-files)
* [Files](/integrations/files)
* [Test format](/core-concepts/test-format)
