Tuesday, 10 September 2013

Convert picture to binary BASE64

Convert picture to binary BASE64

How to convert picture to binary BASE64 and send it by post to anather api
for save.
It looks something like that: 1. User import photo throught the html form
and it transform to binary BASE64 code
base64_encode = Base64.encode64(img_from_fild_form)
data send to enather api (media)
options = { :auth_key=>01qw6, :post_id=>20, :base64_encode=>base64_encode
} HTTParty.post('localhost:9000/save_image', options)

No comments:

Post a Comment