Storage.Controller (PhoenixContribStorage v0.1.0)
View SourcePhoenix controller for serving Storage files.
Add this to your router:
get "/storage/:key", Storage.Controller, :serve
Or for more control:
scope "/storage" do
get "/:key", Storage.Controller, :serve
get "/:key/:filename", Storage.Controller, :serve_with_filename
end
Summary
Functions
Serves a blob as an attachment (forces download).
Serves a file by its storage key.
Serves a blob with appropriate headers.
Serves a file by its storage key with a specific filename in the URL. This is useful for SEO and user-friendly URLs.
Functions
Serves a blob as an attachment (forces download).
Serves a file by its storage key.
Serves a blob with appropriate headers.
Serves a file by its storage key with a specific filename in the URL. This is useful for SEO and user-friendly URLs.