akkoma/lib/pleroma/uploaders/swift/uploader.ex

16 lines
363 B
Elixir
Raw Normal View History

defmodule Pleroma.Uploaders.Swift do
@behaviour Pleroma.Uploaders.Uploader
2018-11-23 09:40:45 -07:00
def get_file(name) do
{:ok, {:url, Path.join([Pleroma.Config.get!([__MODULE__, :object_url]), name])}}
end
2018-11-29 13:11:45 -07:00
def put_file(upload) do
Pleroma.Uploaders.Swift.Client.upload_file(
upload.path,
File.read!(upload.tmpfile),
upload.content_type
)
end
end