AutoIt
AutoIt
Base64 Encode a File
_LANGUAGE_ to Base64 encode the contents of a file.Chilkat AutoIt Downloads
Local $bSuccess = False
; Get the contents of a file into a base64 encoded string:
$oFac = ObjCreate("Chilkat.FileAccess")
Local $strBase64 = $oFac.ReadBinaryToEncoded("c:/data/something.pdf","base64")
If ($oFac.LastMethodSuccess <> True) Then
ConsoleWrite($oFac.LastErrorText & @CRLF)
Exit
EndIf
; Now write the string to a file:
$bSuccess = $oFac.WriteEntireTextFile("c:/data/something_pdf_base64.txt",$strBase64,"us-ascii",False)
If ($bSuccess <> True) Then
ConsoleWrite($oFac.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Success!" & @CRLF)