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

# Upload files

> Upload files to QA Wolf and use them in your test flows.

QA Wolf accepts file uploads via a two-step signed URL process. See [v0/run-inputs-executables-signed-urls](/qawolf/run-inputs-executables-signed-urls).

<Check>
  Make sure you have:

  * Your `QAWOLF_API_KEY` — available under **Workspace Name → Workspace Settings → Integrations → API Access**
</Check>

## Use an uploaded file in a flow

### Mobile apps

Reference the uploaded file using the `RUN_INPUT_PATH` environment variable, which is set automatically when a file is uploaded via the API.

```javascript theme={null}
const APK_PATH = `/home/wolf/run-inputs-executables/${process.env.RUN_INPUT_PATH || "default-file.apk"}`;

const driver = await wdio.startAndroid({
  "appium:app": APK_PATH,
});
```

### Web file upload

Use Playwright's `filechooser` event to intercept the file dialog and set the uploaded file programmatically.

```javascript theme={null}
const fileName = `${process.env.TEAM_STORAGE_DIR}/fileNameHere`;

page.once(
  "filechooser",
  (chooser) => void chooser.setFiles(fileName).catch(console.error)
);

await page.getByText("Upload file").click();
```

<Note>
  Use `page.once` rather than `page.on`. `page.once` registers a one-time event listener that automatically unregisters after the first use. Using `page.on` adds a persistent listener that may interfere with subsequent file uploads in the same flow.
</Note>

### PDF viewing

Use the internal PDF viewer to open an uploaded PDF file in a flow.

```javascript theme={null}
const invoicePath = `${process.env.TEAM_STORAGE_DIR}/invoices/invoice-1.pdf`;

const pdfPage = await context.newPage();
await pdfPage.goto("http://pdf-viewer.psc.qaw.internal");

pdfPage.once(
  "filechooser",
  (chooser) => void chooser.setFiles(invoicePath).catch(console.error)
);

await pdfPage.waitForTimeout(4000);
await pdfPage.click("#openFile");
```

## Supported file types

<AccordionGroup>
  <Accordion title="Mobile apps (.apk, .aab, .ipa)">
    Use a static filename based on the environment (e.g., `app-staging.ipa`) so tests always reference the latest build. See [Mobile build testing](/qawolf/Fastlane-2db5b2a994fb802186a3d88573899c78) for how to automate this as part of your build process.
  </Accordion>

  <Accordion title="ZIP archives (.zip)">
    ZIP files can be used to bundle multiple assets for a single upload. Ensure the contents follow any structure expected by the tests that will consume them.
  </Accordion>

  <Accordion title="CSV files (.csv)">
    CSV files are typically used as test data inputs. Use a consistent filename so flows always pick up the latest version.
  </Accordion>

  <Accordion title="PDF files (.pdf)">
    PDF files can be uploaded for use in test flows that involve document handling or validation.
  </Accordion>
</AccordionGroup>
