Base64 string save to binary file

C

Chunekit Pong

How to save a Base64 encoded string to a binary file

For instance, the following XML tag stores the binary data in a Base64
encoded string
<data>TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx<data>

Any one point to sample code on saving the above string to binary
image (.jpg) file?

base64 class I am using
http://www.adp-gmbh.ch/cpp/common/base64.html
 
T

Thomas J. Gritzan

Chunekit said:
How to save a Base64 encoded string to a binary file

For instance, the following XML tag stores the binary data in a Base64
encoded string
<data>TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx<data>

Any one point to sample code on saving the above string to binary
image (.jpg) file?

base64 class I am using
http://www.adp-gmbh.ch/cpp/common/base64.html

Just use the base64_decode function on this page and pass it the base64
encoded string, then store the result in a file using the write function
of std::eek:fstream (opening in binary mode).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top