> > I like to use ics ftp to transfer the contents direct to a table and not
save it first to disk
> > Could this be possible?
> > Now I'm saving to contents to a file on disk, then read the file and
save the contents to the
> table, wich is time comsuming.
> >
> > Now:
> >
> > 1.open the ftp
> > 2. read one or more files from ftp
> > 3. save one or more files to disk
> > 4. read file from disk and save to table
> > 5. then close ftp
> >
> > I like to
> >
> > 1.open the ftp
> > 2. read file from ftp and save to table
> > 3. then close ftp
> >
> > If not possible with ftp, can this be done with socket to access an ftp
server
> > Would be great for an example
>
> Not sure I understand the problem. Do you mean you want to save a big file
located on a FTP to a
> table locate in a database accessible from a client PC ? Do you mean you
want to avoid saving the
> file to a local file first and save to the table "on the fly".
>
> On solution is to design a TSream derived class that when you write data
to it, data is written to
> your table. FTP component will then be able to use it with his LocalStream
property.
>
I have a small file located on a FTP
I want to read this file, line per line, and save this data direct to a
local table.
So I don't need to save this file first to disk, and read it again.
I took a look at the localSteam property, and tried this example.
The ms.Size give a number, but I can't get the stream into data?
var
ms:TStringStream;
data:string;
begin
ms:=TStringStream.Create(data);
try
FtpClient1.HostName := HostNameEdit.Text;
FtpClient1.Port := PortEdit.Text;
FtpClient1.UserName := UserNameEdit.Text;
FtpClient1.PassWord := PassWordEdit.Text;
FtpClient1.HostDirName := HostDirEdit.Text;
FtpClient1.HostFileName := HostFileEdit.Text;
FtpClient1.LocalStream := ms;
FtpClient1.Binary := True;
FtpClient1.Receive;
DisplayMemo.lines.Add('Memorystream '+IntToSTr(ms.Size));
DisplayMemo.Lines.Add(data);
finally
ms.Free;
end;
end;
>
> --
> Contribute to the SSL Effort. Visit
> http://www.overbyte.be/eng/ssl.html
> --
> [EMAIL PROTECTED]
> Author of ICS (Internet Component Suite, freeware)
> Author of MidWare (Multi-tier framework, freeware)
> http://www.overbyte.be
>
>
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>
>
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be