Elixir/Phoenix file upload folder

不问归期 提交于 2019-12-05 08:59:44

Just figured it out. My mistake was placing plug Plug.Static, at: "/files", from: "media/" at the bottom of Entpoint file, but it should be placed under the existing Plug.Static, like this:

plug Plug.Static,
at: "/", from: :myApp, gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt)

plug Plug.Static, at: "/files", from: "media/"

Or at least before the plug myApp.Router! Then you can access all the files you need.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!