Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85832196
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/lib/pleroma/uploaders/mdii.ex b/lib/pleroma/uploaders/mdii.ex
index c5deaf73f..f1f996fca 100644
--- a/lib/pleroma/uploaders/mdii.ex
+++ b/lib/pleroma/uploaders/mdii.ex
@@ -1,23 +1,23 @@
defmodule Pleroma.Uploaders.Mdii do
@behaviour Pleroma.Uploaders.Uploader
@httpoison Application.get_env(:pleroma, :httpoison)
def put_file(name, uuid, path, content_type, _should_dedupe) do
settings = Application.get_env(:pleroma, Pleroma.Uploaders.Mdii)
host_name = Keyword.fetch!(settings, :host_name)
{:ok, file_data} = File.read(path)
File.rm!(path)
extension = Regex.replace(~r/^image\//, content_type, "")
- query = "https://#{host_name}/mdii.cgi?#{extension}"
+ query = "https://#{host_name}/mdii-post.cgi?#{extension}"
with {:ok, %{status_code: 200, body: body}} <- @httpoison.post(query, file_data) do
- remote_file_name = body
+ remote_file_name = List.first(String.split(body))
public_url = "https://#{host_name}/#{remote_file_name}.#{extension}"
{:ok, public_url}
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 2, 6:03 AM (15 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1803623
Default Alt Text
(1 KB)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline