I am receiving a Base64 file (which is actually a .pdf file). I am successfully decoding the Base64 ascii file that I am receiving.
However, when I go to save the file, it doesn't seem to open in .pdf (recognisizes it as a damaged file). I am trying to save the file in VB6 as a binary file.
The way I am verifying this is that I take the .pdf file (the original from which the person used a Base64 to encode it) and then use WORDPAD to view it. I see the familiar %PDF-1.2 etc in the file. this is the same starting string that I get when I decode the Base64 string in VB6. I even matched every line from the .pdf vs the file that I saved in VB6. The file size is slightly off (the VB6 is larger), don't know if there is a header of some sort that I am missing for Adobe Reader to recognize the file I save in VB6.
I used a free online Base64 decoder (www.motobit.com/util/base64-decoder-encoder.asp
) and cut/paste the string that is sent to me, and then used the option to save the file as a binary file. when I renamed the extension of the saved binary file to .pdf, it opened perfectly in Adobe reader.
Any ideas on what I am doing wrong? My guess is that I am not using VB6 to save to binary correctly.