EncodeFileAsBase64()

Top  Previous  Next

<----------New In Version 4.x---------->

Object: EHL7.HL7Vendors

FileName: EHL7.dll

 

METHOD

 

Name: EncodeFileAsBase64()

Parameters:

1. strFileName (String) - Path / Filename of the file to encode.
2. nMaxSize (Optional Long) Default = 64000, the maximum byte size of the file to encode.

Returns: String (Base64 Encoded) contents of <strFileName> or "" on error.

Description: To Base64 Encode an entire file into a string.  <strFileName> is not modified in any way.

 

Programming Notes:

 

1. <strFileName> must exist
2. If the size of <strFileName> exceeds the value passed in <nMaxSize> then an is generated (See IsError / LastError)

 

Some HL7 interfaces exchange information or reports in OBX or NTE segments in the form of binary files (images, word documents, pdf files) that are Base64 Encoded and placed into an HL7 message.  This function allows you to point to any file on the file system and get back the Base64 encoded data string of the contents of that file.