# `PhoenixKitWeb.FileController`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/phoenix_kit_web/controllers/file_controller.ex#L1)

File serving controller with signed URL support.

Handles secure file retrieval with token-based authentication and cache headers.

# `info`

Get file information without serving the file.

## Request

    GET /api/files/:file_uuid/info

## Response

Success (200):
    {
      "file_uuid": "uuid",
      "original_filename": "photo.jpg",
      "mime_type": "image/jpeg",
      "file_type": "image",
      "size": 1234567,
      "status": "active",
      "variants": [
        {
          "variant_name": "original",
          "mime_type": "image/jpeg",
          "size": 1234567,
          "width": 1920,
          "height": 1080,
          "url": "/file/uuid/original/token"
        }
      ]
    }

# `show`

Serve a file variant by ID with signed URL token.

## Request

    GET /file/:file_uuid/:variant/:token

## Parameters

- `file_uuid`: UUID of the file
- `variant`: Variant name (e.g., "original", "thumbnail", "medium")
- `token`: Signed token for authentication

## Response

Success (200):
- File streamed to client with appropriate headers:
  - `Cache-Control: public, max-age=31536000, immutable` (1 year)
  - `ETag: "md5-hash"`
  - `Content-Type: <mime-type>`
  - `Content-Disposition: inline; filename="..."`

Not Modified (304):
- Returned when request includes `If-None-Match` matching the file ETag

Error (401):
    "Invalid or expired token"

Error (404):
    "File or variant not found"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
