Omni.UI.Files.Plug (Omni UI v0.1.0)

Copy Markdown View Source

Plug that serves session files over HTTP with signed token authorization.

Mount in your router with forward:

forward "/omni_files", Omni.UI.Files.Plug

File URLs use signed tokens that encode the session ID, so only the LiveView that created the token can authorize access to a session's files. Tokens are generated via Omni.UI.Files.URL.file_url/3.

URL format

GET /omni_files/{token}/{filename}

Options

  • :max_age — maximum token age in seconds (default: 86400 = 24 hours)