hello,
i’m using base64 to encode/decode attachments. the encode64 worked fine but the decode returns a binary text and I’m having trouble converting it back to the original attachment.
pathOnClient = “test.png”
version: = the pathOnClient file encoded in base 64
then, I have to decode that file as show it the same way as it was uploaded, like the “pathOnClient” shows. I’ve done tests with File.write() but it returns :ok only.
Sounds like you’re trying to get the contents of the Content-Disposition HTTP header. You got no problems with File.write itself; that one looks to work fine for you.
File.write/3 is not a pure function. It returns :ok but if you look on the filesystem, you will see the file has been created as a side-effect. Then it is up to you how you serve that file to your users - that is an entirely separate issue.