File Storage - Quickstart

Create a bucket, upload a file, and download it - start to finish in under five minutes. The examples below assume a running server at localhost:7474 with default config.

1. Create a bucket

# CLI
anvil storage create-bucket avatars --public --max-size 5MB

# Or via Cypher (in the Hammer UI or anvilent shell)
CREATE BUCKET avatars
  PUBLIC = true,
  FILE_SIZE_LIMIT = 5242880

2. Upload an object

# CLI
anvil storage upload ./alice.png avatars/alice.png

# Or via curl
curl -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: image/png" \
  --data-binary @alice.png \
  http://localhost:7474/storage/v1/object/avatars/alice.png

3. Download or share

# Public bucket: permanent URL, no auth needed.
curl http://localhost:7474/storage/v1/object/public/avatars/alice.png -o alice.png

# Private bucket: mint a signed URL with 1-hour TTL.
anvil storage sign avatars/alice.png --ttl 1h

# Or from code (TypeScript):
const { signedUrl } = await client.storage
  .from("avatars")
  .createSignedUrl("alice.png", 3600);

4. (Optional) inspect usage

anvil storage usage

# Example output:
# Total: 1 object, 4.21 KiB
#
# By bucket:
#   avatars                  1            4.21 KiB

Next: read the dedicated pages on buckets, objects, signed URLs, and image transformations for the details.