How to Download a Static File from Phoenix: Revision history

Jump to: navigation, search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

5 June 2024

  • curprev 15:5115:51, 5 June 2024Admin talk contribs 272 bytes +272 Created page with "<source> defmodule AppWeb.PageController do use AppWeb, :controller def home(conn, _params) do path = Application.app_dir(:app, "priv/test.json") #static directory send_download(conn, {:file, path}) render(conn, :home, layout: false) end end </source>"