GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Six — File Functions (continued)
Overview
The MIMEItemToString function extracts an entry from a MIME Object to a string. Entry content must not contain any zero bytes.
Syntax/Parameters
Syntax
string = MIMEItemToString ( handle hMIME, int index );
Parameters
hMIME
A handle for a MIME Object created with the MIMEOpen function.
index
An int specifying the zero-based index for an item within the MIME Object.
Return Value
Returns a string containing the decoded item data or empty on failure. Use the GetLastError to retrieve a formatted error code.
Remarks
This function decodes the content of an item and returns a string containing the data. Since a string cannot contain raw binary data, if a zero appears in the decoded data, an empty string and the code ERROR_CONTEXT will be returned.
If a content-alternate layer entry is selected, it is automatically an 8-bit ASCII string. It is up to the caller to decode the content.
Note that depending on the layer, an entry will return data for more than one encoded boundary layer. For example, in an EML file, there is usually a layer containing Text and HTML and then separate boundaries for Text and HTML within that layer. For example, data from MIMEGetItemProperties function:
0 - Layer : 0 Name : Encoding : Content-Type : multipart/alternative FileTypeString : 1 - Layer : 1 Name : Encoding : 7bit Content-Type : text/plain FileTypeString : FT_ANSI 2 - Layer : 1 Name : Encoding : quoted-printable Content-Type : text/html FileTypeString : FT_HTML 3 - Layer : 0 Name : zzz-20181231.xfr Encoding : quoted-printable Content-Type : application/octet-stream FileTypeString : FT_XFR
Notice entry 1 is “multipart/alternative” and layer 0 while the two following entries are layer 1 as “text/plain” and “text/html”, respectively. Retrieving item 0 will result in capturing the raw code for both layer 1 items.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.