stavro / arc

:paperclip: Flexible file upload and attachment library for Elixir
1.17k stars 211 forks source link

[Question] How to set asset host for URL's with local storage? #131

Open philipgiuliani opened 7 years ago

philipgiuliani commented 7 years ago

Hi! I am using the Local Storage in dev mode, and S3 in production. But the .url does not return a full URL, but only the absolute path.

I am using arc master and tried to set the asset_host:

config :arc,
  asset_host: "https://localhost:4000"
def storage_dir(_, {_, scope}) do
  "uploads/auth/avatars/#{generate_id(scope.id)}"
end
def avatar_url(account, format \\ :thumb) do
 Avatar.url({account.avatar, account}, format)
end

Its only usable with S3 at the moment or do I have a bug?

PS: I just gave the 400th star 😊

makkrnic commented 7 years ago

@philipgiuliani take a look at my PR #185.