I have a binary files which needs to be sent as a string to a third-party web-service. Turns out it requires that it needs to be base64 encoded.
In ruby I use the following:
body = body << Base64.b64encode(IO.read("#{@postalcard.postalimage.path}"))
body is a strong which conists of a bunch of strings as parameters.
Does this look right? (the file is loaded into the model Postalcard using paperclip)
Thanks.