Base64 string save to binary file

Discussion in 'C++' started by Chunekit Pong, Nov 19, 2008.

  1. 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
     
    Chunekit Pong, Nov 19, 2008
    #1
    1. Advertising

  2. Chunekit Pong schrieb:
    > 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).

    --
    Thomas
     
    Thomas J. Gritzan, Nov 19, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lukasz Lacki

    string -> base64

    Lukasz Lacki, Dec 22, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,660
  2. Guoqi Zheng

    decode base64 string

    Guoqi Zheng, Sep 26, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,845
    Rick Strahl [MVP]
    Sep 27, 2004
  3. Cristiano
    Replies:
    1
    Views:
    4,188
  4. phildog
    Replies:
    1
    Views:
    146
    phildog
    Jun 28, 2007
  5. Shahar Golan
    Replies:
    5
    Views:
    294
    kaeli
    Oct 16, 2003
Loading...

Share This Page