Following the tutorial from smashingboxes.com I included in the endpoint.ex the following lines plug Plug.Static, at: "/uploads", from: Path.expand('./uploads'), gzip: false
Everything goes well, the schema works fine, the files are well saved, and I can see my pictures from the index template.
However when I go to the show template, Phoenix router in order to grab the asset is looking for the picture there GET /posts/uploads/post/thumbnails/1/picture.png instead of here /uploads/post/thumbnails/1/picture.png.
The links generated from the index and show templates by the arc function are identical : <img src="uploads/post/thumbnails/1/picture.png?v=63636129255">
I had to add these lines in the endpoint to help the router ^^: plug Plug.Static, at: "posts/uploads", from: Path.expand('./uploads'), gzip: false
The generated links seem wrong. They should start with “/” at the beginning, so they are absolute path not dependent on wherever the user is inside the app. You should not have to hack on the plug.static path to make it work: the problem is with links themselves.
Quite frankly I don’t understand the behavior of arc. I think you could safely say that the local uploads simply do not work if this is happening and you should probably stick to using S3 instead. Or add “/” everywhere