[DUG] Brain explosion ! (mime64)

Alister Christie alister at salespartner.co.nz
Tue Aug 25 15:05:06 NZST 2009


Doesn't Indy have a bunch of Mime encoding components?

Alister Christie
Computers for People
Ph: 04 471 1849 Fax: 04 471 1266
http://www.salespartner.co.nz
PO Box 13085
Johnsonville
Wellington 



Kyley Harris wrote:
> i use the Free DIMime under Sourceforge.. works perfectly has lots of 
> options.
>
> On Tue, Aug 25, 2009 at 2:46 PM, Pieter De Wit <pieter at insync.za.net 
> <mailto:pieter at insync.za.net>> wrote:
>
>     Hi,
>
>     Maybe you should pad this string to 4 before encoding it ?
>
>     Cheers,
>
>     Pieter
>
>     On Tue, 25 Aug 2009, Robert martin wrote:
>
>     > Hi
>     >
>     > I have a set of functions (not written by me) that encode and decode
>     > mime64 data.  I want to take a file and mime64 encrypt it than at a
>     > later point decrypt it.  However I am having trouble calling the
>     > functions and there is no help.
>     >
>     > Functions
>     >
>     > function Base64Encode(const InText: string): string; overload;
>     >
>     > function Base64Decode(const InText: string): string; overload;
>     >
>     >
>     > To do the encode I have the following function
>     >
>     > var
>     >    fs          : TFileStream;
>     >    BufferIn    : AnsiString;
>     > begin
>     >    fs := TFileStream.Create(FileName, fmOpenRead);
>     >    try
>     >        fs.Position := 0;
>     >
>     >        SetString(BufferIn, nil, fs.Size);
>     >        fs.Read(Pointer(BufferIn)^, fs.Size);
>     >        Result := Base64Encode(BufferIn);
>     >    finally
>     >        fs.Free;
>     >    end;
>     >
>     >
>     > I use a string list to save the output.  I thought this was
>     working but
>     > when I come to decode it the system checks and finds it is an
>     invalid
>     > file (does not divide evenly by 4).  Can anyone see what might
>     be wrong
>     > with the above?
>     >
>     > Cheers
>     > Rob
>     >
>     > _______________________________________________
>     > NZ Borland Developers Group - Delphi mailing list
>     > Post: delphi at delphi.org.nz <mailto:delphi at delphi.org.nz>
>     > Admin: http://delphi.org.nz/mailman/listinfo/delphi
>     > Unsubscribe: send an email to delphi-request at delphi.org.nz
>     <mailto:delphi-request at delphi.org.nz> with Subject: unsubscribe
>     >
>     _______________________________________________
>     NZ Borland Developers Group - Delphi mailing list
>     Post: delphi at delphi.org.nz <mailto:delphi at delphi.org.nz>
>     Admin: http://delphi.org.nz/mailman/listinfo/delphi
>     Unsubscribe: send an email to delphi-request at delphi.org.nz
>     <mailto:delphi-request at delphi.org.nz> with Subject: unsubscribe
>
>
>
>
> -- 
> Kyley Harris
> Harris Software
> +64-21-671-821
> ------------------------------------------------------------------------
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe


More information about the Delphi mailing list