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

# File Storage

> Upload, manage, and access files across your fal applications.

fal provides persistent file storage at `/data` that is shared across all your runners and applications. Use it to store model weights, datasets, and any files your apps need.

## Using `/data` in Your App

The `/data` directory is automatically mounted on every runner. Files you write there persist between requests and across deployments.

```python theme={null}
import fal

class MyModel(fal.App):
    machine_type = "GPU-A100"

    def setup(self):
        import torch
        model_path = "/data/models/my-model.pt"

        if os.path.exists(model_path):
            self.model = torch.load(model_path)
        else:
            self.model = download_and_save(model_path)
```

<Note>
  `/data` is an eventually-consistent distributed filesystem. When writing files, use atomic operations (write to a temp file, then move) to avoid race conditions if multiple runners write simultaneously.
</Note>

## Uploading Files

### Dashboard

Navigate to [**Dashboard > Files**](https://fal.ai/dashboard/files) to manage your files visually:

* **Drag and drop** files to upload
* **Upload from URL** to pull files from external sources
* Organize files in **folders**
* Download, copy paths, or delete files

### SDK

Upload files programmatically from your code:

```python theme={null}
from fal.toolkit import File

# Upload from local file
file = File.from_path("path/to/file.bin")
print(file.url)

# Upload from bytes
file = File.from_bytes(data, "output.png", content_type="image/png")
print(file.url)
```

### CLI

Upload and manage files using the fal CLI:

```bash theme={null}
# List files
fal files list

# List files in a directory
fal files list models/

# Upload a file
fal files upload local-file.bin remote-path/file.bin
```

### REST API

For direct integration, use the Platform APIs:

* `POST /serverless/files/file/local/{target_path}` -- Upload a file directly
* `POST /serverless/files/file/url/{file}` -- Upload from a URL
* `GET /serverless/files/list` -- List files
* `GET /serverless/files/file/{file}` -- Download a file

<Card title="Platform API Reference" icon="arrow-right" href="/docs/api-reference/platform-apis/for-serverless">
  See the full file management API specification
</Card>

## Storage Details

| Property          | Value                                              |
| ----------------- | -------------------------------------------------- |
| **Mount path**    | `/data` on all runners                             |
| **Shared across** | All apps and runners in your account               |
| **Consistency**   | Eventually consistent                              |
| **Max file size** | Up to 50 GB (resumable upload), \~1 TB (multipart) |
| **Persistence**   | Files persist until you delete them                |

## CDN File Uploads

When your app generates output files (images, videos, audio), they're uploaded to fal's CDN and returned as URLs. These are separate from `/data` storage -- see [Media Expiration](/docs/documentation/model-apis/media-expiration) to control how long CDN files are retained.
