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