Base64 file encode - fstream

this may help

http://www.cplusplus.com/doc/tutorial/files/