I am using Ruby On Rails, and accessing a API which is returning me baseencoded string and a checksum for a png type image.
However when i try to create a image from this, its not getting created and i see a message saying image might be corrupt. I might be doing this correctly.
Here is a little more description about the encoded string and checksum
encoded string is form of a Base64-encoded, GZipcompressed
string.
checksum is An MD5 hash to validate the above data, in the form of a
Base64-encoded string.
Here is my approach
file = File.new(path,"wb")
file.write Base64.decode64("encodedtext")
file.close
am i doing anything wrong?
However i am not sure what role the checksum plays, can anyone please suggest what i might be doing wrong, Thanks.