> For the complete documentation index, see [llms.txt](https://docs.theopenpresenter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.theopenpresenter.com/development/media-storage.md).

# Media Storage

We currently have 2 storage types that you can use.

1. File storage
2. S3 storage

This can be set through the `STORAGE_TYPE` environment variable. There are corresponding env that you can set to configure that storage type. S3 for example:

```
STORAGE_S3_BUCKET=
STORAGE_S3_REGION=
STORAGE_S3_ENDPOINT=
STORAGE_S3_ACCESS_KEY_ID=
STORAGE_S3_SECRET_ACCESS_KEY=
```

### Storage Proxy

The URL of the media will always be pointing to **your-url.com/media/data/\[file]**.

As such, you could serve the media through any methods by resolving that URL. It may be useful to hook it up to a CDN like Cloudflare to reduce unnecessary server load. In practice, you could set a redirect from that URL to another subdomain in Cloudflare to get granular access of what you serve.&#x20;

We also provide the `STORAGE_PROXY` env variable. This setting controls whether you want the server to serve the media on the path mentioned above.

When `STORAGE_PROXY` is **local**, it will serve the static files in the server. This only works if `STORAGE_TYPE` is **file**.

You could also set `STORAGE_PROXY` to any URL. This will in turn proxy the request to the specified URL.

Alternatively, pass any other value and the proxy will be disabled.

### Changing between storage type

We currently do not have any mechanism to handle changing between storage types. Changing how the server handles it is just a simple envvar change. However, you'll need to migrate the data between storage type manually.

### Serving media yourself

Cloudflare

Cache

CORS


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.theopenpresenter.com/development/media-storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
