View Source Waffle.Storage.Local (waffle v1.1.9)

Local storage provides facility to store files locally.

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

Summary

Functions

Link to this function

delete(definition, version, file_and_scope)

View Source
Link to this function

put(definition, version, arg)

View Source
Link to this function

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

View Source