Convert binary text into file

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.