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

# Upload Files

> Upload files from server paths using the Python client

## files.upload

Upload files from paths visible inside the server container (typically `/uploads/...`). Place files under `~/.moorcheh/uploads` on the host before calling the API.

```python theme={null}
client.files.upload(
    namespace_name: str,
    *,
    files: list[dict],
) -> dict[str, Any]
```

**API:** `POST /namespaces/{namespace_name}/files` — see [Upload file](/on-prem/api-references/files/upload)

### Examples

```python theme={null}
from pathlib import Path
from moorcheh import MoorchehClient
from moorcheh.docker_runtime import ensure_upload_dir, host_path_to_container_upload_path

with MoorchehClient("http://localhost:8080") as client:
    upload_root = ensure_upload_dir()
    host_file = (upload_root / "document.pdf").resolve()
    container_path = host_path_to_container_upload_path(host_file, upload_root)

    resp = client.files.upload(
        "my-documents",
        files=[
            {"path": container_path, "department": "engineering", "force_reindex": False}
        ],
    )
    job_id = resp["job_id"]

    while True:
        job = client.files.job_status("my-documents", job_id)
        if job["status"] in ("completed", "failed"):
            break
```

## Related Operations

* [File Job Status](/on-prem/python-client/files/file-job-status)
* [List Files](/on-prem/python-client/files/list-files)
* [CLI: moorcheh upload-file](/on-prem/cli/files/upload-file)
