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

# Upload Input File

> Upload a local file so it can be attached to a test case input.

> [!WARNING]
>
> You are reading the docs of Galtea 5.14. [Read this page in the latest version](https://docs.galtea.ai/sdk/api/test-case/upload-input-file.md).

Use this when you build the test case input yourself. To attach files while creating a test case, pass `input_file_paths` to [Create Test Case](https://docs.galtea.ai/v5.14/sdk/api/test-case/create.md) instead: it is shorter and does the same upload.

The one thing this method gives you that `input_file_paths` does not is reuse. Upload a document once and attach the same `AttachedFile` to many test cases, rather than uploading it per test case.

On the answer side, [Upload Output File](https://docs.galtea.ai/v5.14/sdk/api/trace/upload-output-file.md) does the same for a turn whose reply is a document.

## Returns

Returns an `AttachedFile` with `uri`, `filename` and `mime_type`. Place it in the input's `content` list.

> [!NOTE]
>
> `AttachedFile` used to be called `InputFile`, back when only an input could carry files. The same four fields now describe a file on either side. `InputFile` still works as a name for it, so code you already wrote keeps running, but it now warns with a `GalteaDeprecationWarning`. Switch to `AttachedFile` when you next touch that code.

The `uri` still carries the upload's signature and expires. Galtea replaces it with a signature-free storage reference when the test case is written, and that is the one `test_case.input_files` reads back. Store that one, not this one.

## Example

```python theme={"system"}
lease = galtea.test_cases.upload_input_file("path/to/lease-agreement.pdf")

for question in ["Which clauses limit the cover?", "What is the excess?"]:
    galtea.test_cases.create(
        dataset_id=dataset.id,
        input={"user_message": question, "content": [lease.model_dump(by_alias=True)]},
    )
```

## Parameters

**file\_path** `string` *required*

Path to the file on the machine running the SDK. One file may be up to 20 MB, and must be one of these types: `pdf`, `docx`, `xlsx`, `pptx`, `rtf`, `png`, `jpg`, `jpeg`, `tiff`, `tif`, `bmp`, `webp`, `heic`, `heif`, `gif`, `txt`, `csv`, `md`, `html`, `xml`, `json`, `eml`. A storage URI is refused: there is nothing on this machine to upload, so attach it directly instead.

> [!WARNING]
>
> Evaluators cannot read files yet. A metric that reads the input is **skipped** when no turn is left with text of its own; log the text your pipeline extracted as the turn input, without the file, to have it scored. This is true for both run styles: your own pipeline, and Galtea calling your endpoint. On deployments that do not send files to the judge, the evaluator also skips LLM-as-a-judge metrics other than the DeepEval-based ones when any turn the metric reads carries a file. See [File inputs](https://docs.galtea.ai/v5.14/concepts/product/dataset/test-case.md#file-inputs).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.