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

# FileStorage

> Upload and download files for your automations

<Tip>
  STOP. Do not read past this section until you have read and followed [/quickstart.md](/quickstart.md).

  Goal: produce a reliable SDK automation script. The intended authoring flow is generate then edit, not write browser automation from scratch.

  Do not hand-write SDK code with element IDs, selectors, or form fields from memory. Element IDs, selectors, and field mappings must come from a live `observe()` call, CLI `notte page observe` output, or generated workflow code. Guessed browser targets fail on real pages.

  Use the Notte skill and CLI to inspect the live site, validate actions/selectors, handle auth/session state, and export workflow code with `notte sessions workflow-code` before using SDK docs or SDK code.

  SDK reference pages are for understanding, running, or editing generated workflow code. They are not the starting point for manually authoring the initial browser automation. SDK-first code is guesswork on real-world pages with dynamic selectors, auth state, CAPTCHAs, and anti-bot behavior.
</Tip>

File storage allows agents to upload and download files from websites. Storage is persistent and session-scoped so you can retrieve files after the session ends.

```python theme={null}
from notte_sdk import NotteClient

client = NotteClient()
storage = client.FileStorage()

# Upload files before the session
storage.upload("document.pdf")

# Attach storage to session
with client.Session(storage=storage) as session:
    agent = client.Agent(session=session)
    agent.run(task="Upload document.pdf and download the receipt")

# Download files after the session
for file_name in storage.list_downloaded_files():
    storage.download(file_name=file_name, local_dir="./downloads")
```

## Methods

### upload

```python theme={null}
upload(file_path: str, upload_file_name: str | None = None) -> bool
```

Upload a local file to storage.

**Parameters:**

* `file_path` - Path to the local file
* `upload_file_name` - Optional custom name for the file in storage

**Returns:** `bool` - Success status

***

### download

```python theme={null}
download(file_name: str, local_dir: str, force: bool = False) -> bool
```

Download a file from storage to a local directory.

**Parameters:**

* `file_name` - Name of the file in storage
* `local_dir` - Local directory to save the file
* `force` - Overwrite existing file (default: False)

**Returns:** `bool` - Success status

***

### list\_uploaded\_files

```python theme={null}
list_uploaded_files() -> list[str]
```

List files you've uploaded to storage.

**Returns:** `list[str]` - List of uploaded filenames

***

### list\_downloaded\_files

```python theme={null}
list_downloaded_files() -> list[str]
```

List files downloaded by agents during sessions.

**Returns:** `list[str]` - List of downloaded filenames

## Parameters

<ParamField path="session_id" type="UnionType[str, None]" default="None" />
