Uploading not works with binary as base64 decoded
Closed this issue · 2 comments
Victoria91 commented
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".
achempion commented
Hi,
There are not enough information to give you a proper response.
P.s. I have the same case (decoding file from base64 and storing it),
except I store it locally not in S3.
Probably, you could try to switch to the local storage in order to
understand does your bug depend on S3 specifically or not.
Also, test case is welcome.
achempion commented
Feel free to re-open the issue.