- with {:ok, %{status_code: 200, body: body}} <- @httpoison.post(query, file_data) do
- remote_file_name = body
- public_url = "https://#{host_name}/#{remote_file_name}.#{extension}"
- {:ok, public_url}
+ with {:ok, %{status: 200, body: body}} <-
+ HTTP.post(query, file_data, [], adapter: [pool: :default]) do
+ remote_file_name = String.split(body) |> List.first()
+ public_url = "#{files}/#{remote_file_name}.#{extension}"
+ {:ok, {:url, public_url}}
+ else
+ _ -> Pleroma.Uploaders.Local.put_file(upload)