elixir-waffle/waffle_ecto

Uploading not works with binary as base64 decoded

Closed this issue · 2 comments

Simple example:

base64_decoded = (File.cwd!() <> "/assets/static/images/phoenix.png") |> File.read! |> Base.encode64 |> Base.decode64!
Organizations.create_organization(%{name: "name", logo: %{filename: "phoenix.png", binary: base64_decoded}})

Creation itself is successfull, record is created with attributes logo: %{file_name: "phoenix.png", updated_at: ~N[2020-07-02 18:30:19]}, however the image is not uploaded, the url will response with 404 error. When uploading with %Plug.Upload{}, everything works ok. When storing via Uploader.store directly everything also works fine

The storage is Waffle.Storage.S3, and content_encoding is set to "base64".

Feel free to re-open the issue.