Waffle.Storage.Local (waffle v1.1.8)

Local storage provides facility to store files locally.

local-configuration

Local configuration

config :waffle,
  storage: Waffle.Storage.Local,
  # in order to have a different storage directory from url
  storage_dir_prefix: "priv/waffle/private",
  # add custom host to url
  asset_host: "https://example.com"

If you want to handle your attachments by phoenix application, configure the endpoint to serve it.

defmodule AppWeb.Endpoint do
  plug Plug.Static,
    at: "/uploads",
    from: Path.expand("./priv/waffle/public/uploads"),
    gzip: false
end

Link to this section Summary

Link to this section Functions

Link to this function

delete(definition, version, file_and_scope)

Link to this function

put(definition, version, arg)

Link to this function

url(definition, version, file_and_scope, options \\ [])