benonymus
Arc access denied on link to file with @acl :public_read
Hey there,
I am trying to add a new image type and even though
@acl :public_read
is being set on module level as in my other image types but in this case it seems to not apply I keep getting
AccessDeniedAccessDeniedB3D18E1CE208EC64Nbf1dF8Cs/PhywfqdkcNMAfVnwWBWPlNOs3dXaRbhNhVYEeKEaYi90MzstIPjimLYpAwQJMWuKQ=
why is that?
here is my code:
defmodule projx.EventImage do
use Arc.Definition
use Arc.Ecto.Definition
@extension_whitelist ~w(.jpg .jpeg .gif .png)
@versions [:original]
@acl :public_read
def validate({file, _}) do
file_extension = file.file_name |> Path.extname() |> String.downcase()
Enum.member?(@extension_whitelist, file_extension)
end
def filename(_version, {file, scope}) do
file_name = Path.basename(file.file_name, Path.extname(file.file_name))
"event_image_#{scope.id}_#{file_name}"
end
# Override the storage directory:
def storage_dir(_version, {_file, _scope}) do
Application.get_env(:projx, :s3_upload_path)
end
end
Marked As Solved
benonymus
ok it was not that, I need to use the uuid not the id of the scope in the filename!
Also Liked
kokolegorille
Just to mention Arc as been forked recently as it was not really maintained.
It’s not difficult to migrate, in case, change arc to waffle.
3
Popular in Questions
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
can someone please explain to me how Enum.reduce works with maps
New
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it.
I’m very interested in Elixir,...
New
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size?
Thanks
New
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work.
Or rather, not char, but a substr...
New
In AR this is so simple
@articles = current_user.articles
How to do in Ecto?
def index(conn, _params) do
current_user = conn.assig...
New
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217
Let’s say I have a map with required and optional k...
New
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
Other popular topics
Hi! May someone helps me, please!
I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
Hello!
tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability.
After spen...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
What is most correct way to open, read and parse JSON file with poison?
For example if we have example.json file in root of some projec...
New
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New







