Posted by Robert G Laurin on May 19, 2010 at 19:36:57:
In Reply to: Re: Sendmail Logic posted by Herb Walters on May 19, 2010 at 15:40:22:
Hi Herb,
The "encrypted" attachment is NOT an encrypted attachment... It is a base64 data stream. Basically it takes the 8 bits characters (hex 00 to FF) and convert them to a 6 bits value (0-63) using "printable" characters A-Z, a-z, 0-0, '+' and '/'. Each 3 characters is converted into 4 characters (do Wiki search on Base64).
Comet also has a Base64 function.
The specs for MIME and Base64 is that you read the "attachment" and encode them with a line no more than 76 characters long. If my math is good, it means that you have to parse the input file at 57 characters (57/3*4=76). Separate each line with a CR+LF and pad the last set with '=' to make it exactly 4 character long.
I also noticed extra characters '=EF=BB=BF' at the beginning oh the HTML section just before the You are close my friend, very close. You clean your headers a bit, get rid of the X-something that does not do much here. You HTML code could also be simplified - keep it short.
Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.