Re: IdDecoderMIME1.


2003-10-13 10:46:57 PM
delphi83
Liukin writes:
Quote
From: "Liukin" <XXXX@XXXXX.COM>
Lines: 461
I cancelled this post due to the excessive length. Please post
attachments to borland.public.attachments *only* -- do not quote them
inline in your message. Doing so is obnoxious to people who read
newsgroups over a dial-up line.
The non-attachment portions of the message are quoted below.
Quote

Hi.
I have some file store in a SQL databank onto a BLOB FIELD.
I can save the file from the BLOB FIELD to a file.
I do not know hoaw the file is stored in the datanak (store by other
peaple, but readable from other applications). I have a field who
give me the file format(TXT,DOC....)

Now when i try to read the file, it is look like this :


application/msword

0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7-CQAGAAAAAAAAAAAAAAABAAAAIQAAAA
AAAAAA
EAAAIwAAAAEAAAD+----AAAAACAAAAD---------------------------------------
------
----------------------------------------------------------------------
------
----------------------------------------------------------------------
------
----------------------------------------------------------------------
------
----------------------------------------------------------------------
------
----------------------------------------------------------------------
------
----------------------------------------------------------------------
------
----------------------------------------------------------------------
-----s
pcEAOSAJBAAA8BK-AAAAAAAAEAAAAAAABAAADwQAAA4AYmpiav3P-c8AAAAAAAAAAAAAAA
AAAAAA
AAAMBBYALgwAAJ+lAACfpQAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD--w
8AAAAA
[snip]
Quote
This file is encoded. So to read properly the file , I am using this
code to read the file and creat a new file in correct format :

TForm1.convert(Sender: TObject);

var F,d: textfile;
fic,L:String;
begin

//Extention is the original format of the file

fic:= 'C:\Documents and Settings\lilian\Bureau\test1'+extention;
AssignFile(d,fic);
Rewrite(d);

AssignFile(F,'C:\Documents and Settings\lilian\Bureau\work.tmp');
Reset(F);
Readln(F, L); // to jumb the first line of the file
while not EOF(F) do
begin
Readln(F, L);
Writeln(d,IdDecoderMIME1.DecodeString(L));
end;
CloseFile(F); // ferme le fichier
CloseFile(d);
end;



It's works properly when it is a TXT file. but as soon as i have other
kind of file (.DOC/XLS/PDF) it s do not work properly.
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : delphi.weblogs.com
InterBase Performance Monitor -- Analyze and control your IB7
server: delphi.weblogs.com/IBPerformanceMonitor