I am trying to specify absolute storage path in arc uploader.
def storage_dir(version, {file, scope}) do
"#{Application.get_env(:firefly, :image_store)}/images/#{scope.identifier}/"
end
I want something like above so I can specify storage directory using absolute path. It works perfectly but when I generate urls arc_ecto returns complete filepath including “/home/user/”. In that case I’ll need to convert those urls into http urls via string replace which isn’t good.
On other hand if I use relative path like
def storage_dir(version, {file, scope}) do
"uploads/images/#{scope.id}/"
end
than I cannot specify parent directories for storing images. Is there any way around this without doing string replace for each urls???