As the other posters have hinted at, you just need to use the Convert
class and a way to write the data to disk (FileStream works nicely).
Assuming your base64 data is in a string named receivedBase64string, and
you want to write it to the file c:\received.data
using System.IO;
byte[] rawData = Convert.FromBase64String(receivedBase64string);
using (FileStream fs = new FileStream(
@"c:\received.dat",
FileMode.Create))) {
fs.Write(rawData, 0, rawData.Length);
}
Joshua Flanagan
http://flimflan.com/blog
LP wrote:
A web service returns base64 encoded data. The goal is to parse it and store
it into binary file with .dat extension. This file is then will be used by a
custom program to produce diagrams. As far as I know base64 data is not any
known graphic format, from what I understand it's just encoded stream of
bytes. Which I need to write to .dat file. Where to start? any links or
suggestions?
Thank you.