Elixir/Phoenix file upload folder
<p>So I'm trying to set up upload functionality on the website. However, I'm struggling with the location where to keep the uploaded files.</p>

<p>I followed the phoenix guidelines, added <code>plug Plug.Static, at: "/files", from: "/media", gzip: false</code> to my Endpoint file, and created the /media folder in the root of the project. But keep getting error: <code>no route found for GET /files/3-news.jpg (Kz.Router)</code> .</p>

<p>I'm not sure what I'm doing wrong, maybe the location of <code>/media</code> folder is incorrect? I've put it into the root, where others folders are, such as web, priv, test, etc. Is it the right place? Or the path has to be full OS path, like <code>/Users/Jack/Desktop/myApp/media/</code> ?</p>

<p>Thanks in advance guys, and any advise appreciated!</p>

<p>P.S. I'm able to upload files with <code>File.cp(upload.path, "media/#{file_name}")</code> and they appear in <code>/media</code>, but still can't access them via <code>http://localhost:4000/files/4-news.jpg</code></p>