Visual FoxPro
Visual FoxPro
Get Contents of File as Base64
See more Encryption Examples
Demonstrates how to read the contents of a file and convert to a base64 string.Chilkat Visual FoxPro Downloads
LOCAL lnSuccess
LOCAL loBd
lnSuccess = 0
loBd = CreateObject('Chilkat.BinData')
lnSuccess = loBd.LoadFile("qa_data/jpg/starfish.jpg")
IF (lnSuccess = 0) THEN
? "Failed to load file."
RELEASE loBd
CANCEL
ENDIF
? loBd.GetEncoded("base64")
* If you want mult-line base64:
? "--"
? loBd.GetEncoded("base64_mime")
* If you want hex..
? "--"
? loBd.GetEncoded("hex")
* etc.
RELEASE loBd