> For the complete documentation index, see [llms.txt](https://docs.does.qa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.does.qa/test-steps/action/file.md).

# File

File chooses a file and uploads it through a file input on the page. Use it after you have downloaded or generated the file you need in an earlier step.

![File Test Step](https://app.does.qa/screenshots/node/action_input_file.png)

## When to use it

* Upload a file the Flow just downloaded.
* Upload a file created with [Generate file](/test-steps/runner/generate-file.md).
* Pair with [Open file](/test-steps/browser/open-file.md) when you need to open a downloaded file in the browser instead of uploading it.

## Example Flow

Generate a file, then upload it with File.

![Generate file then File upload](/files/J2WSUbMfRA9E3lh4oJPX)

## Configure

### Basics

| Field              | What to set                                              |
| ------------------ | -------------------------------------------------------- |
| **Element**        | The file input [Element](/elements/creating-elements.md) |
| **File**           | `Last Downloaded` (default) or `Generated File`          |
| **Generated File** | The generated file to upload when File is Generated File |

### Advanced

| Field                                 | What to set                                          |
| ------------------------------------- | ---------------------------------------------------- |
| **Status on fail**                    | [Failed Status](/test-step-options/failed-status.md) |
| **When should screenshots be taken?** | `Always` (default) or `On Failures`                  |

{% hint style="info" %}
**Pro tip:** Download or generate the file in an earlier step in the same Test Case so Last Downloaded or Generated File points at the right content.
{% endhint %}

## Related

* [Generate file](/test-steps/runner/generate-file.md)
* [Open file](/test-steps/browser/open-file.md)
* [Test file uploads and downloads](/guides/test-file-uploads-and-downloads.md)
* [Action](/test-steps/action.md)

**Tags:** `action`, `input`, `file`, `upload`
