:EncodeFile() - Encodes a file, storing the contents as printable text in the specified file.


Class

     aprEncode()

 

Syntax

     :EncodeFile(cInFile, cOutFile[, nOptions]) --> lSuccess

 

Parameters

 

cInFile

Filename of the File to be Encoded

 

cOutFile

Filename the file that is to contain the Encoded data

 

nOptions

Optional: A bitmask which specifies one or more options. This parameter is constructed by using the bitwise OR operator with any of the following values:

 

*

FILE_ENCODE_BASE64

Default: Use the base64 algorithm for encoding the file. This is the encoding method that is used by most modern e-mail client software. Note that this option cannot be combined with the FILE_ENCODE_UUCODE or FILE_ENCODE_QUOTED option.

FILE_ENCODE_UUCODE

Use the uuencode algorithm for encoding the file. This is a common encoding method used UNIX systems and older e-mail client software. Note that this option cannot be combined with the FILE_ENCODE_BASE64 or FILE_ENCODE_QUOTED option.

FILE_ENCODE_QUOTED

Use the quoted-printable algorithm for encoding the file. Note that this option cannot be combined with the FILE_ENCODE_BASE64 or FILE_ENCODE_UUCODE option.

FILE_ENCODE_COMPRESSED

The file should be compressed before it is encoded. To restore the original contents of the file, it must be expanded after it has been decoded.

 

* = Default Value

 

Return

     lSuccess. .T. if the file could be Encoded and written to cOutFile. Otherwise .F.

     If the operation failed, look at :nErr and :cErr for more information.

 

Description

     Encodes the contents of the specified file and write the results to an output file (cOutFile).

     

The :EncodeFile() Method converts binary data files to a format that contains only printable ASCII characters. The option to compress the file requires that the Method be able to create a temporary file on the local system in the directory specified by the TEMP environment variables. A compressed file must be expanded with the :DecodeFile() or :ExpandFile() Methods. The compressed file is not stored in an archive format that is recognized by third-party applications such as PKZip or WinZip.

 

See Also

 :DecodeFile, :CompressFile, :ExpandFile