NetCode Class
Properties Methods Events Configuration Settings Errors
The NetCode component can be used to encode or decode files or strings using a variety of popular encoding formats such as: Base64, UUencode, URL, etc. UUEncode , MIME's Base64 Quoted-Printable , URL encoding formats, as well as secure hash functions such as MD5 and SHA1, are currently supported.
Class Name
IPWorks_NetCode
Procedural Interface
ipworks_netcode_open(); ipworks_netcode_close($res); ipworks_netcode_register_callback($res, $id, $function); ipworks_netcode_get_last_error($res); ipworks_netcode_get_last_error_code($res); ipworks_netcode_set($res, $id, $index, $value); ipworks_netcode_get($res, $id, $index); ipworks_netcode_do_config($res, $configurationstring); ipworks_netcode_do_decode($res); ipworks_netcode_do_encode($res); ipworks_netcode_do_resetdata($res);
Remarks
The encoding format is specified by the Format property. The binary data, or the name of the file containing binary data, is specified by the DecodedData property and the encoded data or filename is specified by the EncodedData property. The FileName property may be used to override the default file names or to specify a directory during uuencoding. After uudecoding, the FileName property contains the fully specified file name of the decoded file.
Understanding Encoding/Decoding
Most of mail systems use only 7 bits to transmit messages. A binary file such as an archive or a non-plain text formatted file produced from a text processor should be first encoded in 7 bit code before email transfer.
Decoding is the inverse process: creation of the original file from the encoded data. Encoded data is often split over several files because of the size limit placed on the email message. Each message is preceded by information about this splitting, as well as the mail header. NetCode supports this case in both directions:
- During encoding setting the MaxFileSize config setting to the maximum size of a message body instructs NetCode to split the encoded data over several files. Multiple filenames can be specified by using question marks "?" (See the EncodedData property for more information).
- During decoding, the body messages can be saved in separate files named namexxx.ext where xxx is a numeral starting at 000 and ext is ".uue", ".b16", or ".q_p" according to Format. These multiple filenames should be given to EncodedData.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
DecodedData | The decoded data. |
DecodedFile | The filename of the decoded data. |
EncodedData | The encoded data. |
EncodedFile | Filename of the encoded data. |
FileCnt | Shows the number of encoded files the component has read from or written into. |
FileName | The destination filename for the encoded data. |
Format | The type of encoding to be used. |
Mode | The UNIX-style filemode when uuencoding / uudecoding. |
Overwrite | Controls whether created file(s) should overwrite already existing file(s). |
ProgressStep | Controls the granularity at which the Progress event is fired. Values 0-100. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting . |
Decode | Decode string. |
Encode | Encode the data. |
ResetData | Resets the values of all data and stream properties. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Error | Information about errors during data delivery. |
Progress | Occurs when PercentDone of the input is read. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
Base64LineBreak | Tells the component whether to include line breaks in Base64 encoded content or not. |
HMACAlgorithm | The hash algorithm to use when generating a Hash-based Message Authentication Code (HMAC). |
HMACKey | A key to use when generating a Hash-based Message Authentication Code (HMAC). |
MaxFileSize | When encoding, controls whether encoded data should be split into several files and gives the maximum allowed size for these files. |
UseModifiedUTF7 | Specifies whether or not a modified form of UTF-7 for IMAP mailbox naming is used. |
UseExtendedHexBase32 | Specifies whether or not the Extended Hex alphabet is used. |
CodePage | The system code page used for Unicode to Multibyte translations. |