---
title: "Media and storage"
description: "Where a post's video comes from — a public URL, or a file in mixetape storage."
---

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

# Media and storage

A post's `mediaUrl` is either:

- a **public https URL** that the platform can fetch, or
- an **`r2://` URL** of a file in mixetape storage.

> **Prefer storage**
>
> The platform fetches the media only at the post's lead time, possibly days later. A link from
> a render service or a signed URL may have expired by then; a file in mixetape storage has not.
> See [Tips](/tips#keep-the-media-in-mixetape-storage).

## Uploading a file

`create_upload` returns a presigned `uploadUrl`, valid for 6 hours. Send the whole file (up to
5 GB) in **one PUT**, with exactly the `Content-Type` it returns — no API key is needed for
the PUT itself. The tool also returns a ready `curl` command:

```sh
curl -X PUT "<uploadUrl>" -H "Content-Type: video/mp4" --data-binary @episode-12.mp4
```

Then schedule the post with the returned `url` (`r2://…`).

## Importing from a URL

`import_file` copies a file from a public https URL (up to 5 GB, with a `Content-Length`) into
storage — for example a render service's link that expires. mixetape fetches it; nothing is
sent from your machine.

## Housekeeping

`list_files` lists your files, newest first, with their `r2://` URL and size. `delete_file`
removes one — a post that still points at it will fail to upload, so only delete files you no
longer need.

Source: https://docs.mixetape.com/concepts/media/index.mdx
