| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Encodes a file base 64.
HB_Base64EncodeFile( <cFilename>, <cBase64File> ) --> NIL
The return value is always NIL.
HB_Base64EncodeFile() reads an entire file, encodes it base 64, and writes the encoded data into a second file.
| See also: | HB_Base64Decode(), HB_Base64DecodeFile(), HB_Base64Encode() |
| Category: | Encoding/Decoding , xHarbour extensions |
| Source: | tip\encoding\Base64.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example outlines base 64 encoding and decoding of files.
// A PRG file is encoded in a second file which is decoded into
// a third file. The contents of the original and third file are
// identical.
PROCEDURE Main
LOCAL cFileIn := "HB_Base64.prg"
LOCAL cFileOut := "HB_Base64.enc"
HB_Base64EncodeFile( cFileIn, cFileOut )
HB_Base64DecodeFile( cFileOut, "Test.txt" )
? Memoread( cFileIn ) == MemoRead( "Test.txt" ) // Result: .T.
RETURN
http://www.xHarbour.com