Put file through ScSFTPClient from Stream.

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
hjorturb
Posts: 6
Joined: Fri 15 Jan 2010 17:02

Put file through ScSFTPClient from Stream.

Post by hjorturb » Wed 03 Feb 2010 16:20

Hi

Is there any way to send a StringList through ScSFTPClient and store as a file on the sFtp site? I have to do it that way since I am not allowed to store it in file because of content of the stringlist.

Best regards,

Hjortur.
Iceland.

hjorturb
Posts: 6
Joined: Fri 15 Jan 2010 17:02

Post by hjorturb » Thu 04 Feb 2010 02:50

I can see there is a Procedure that is called "WriteFile". Has anyone some example code to use that one?

Best regards,
Hjortur.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 04 Feb 2010 09:07

You can use the following code:

Code: Select all

Handle := ScSFTPClient.OpenFile(Fielname, [foCreate, foRead, foWrite]);
s := StringList.Text;
ScSFTPClient.WriteFile(Handle, 0, s[1], Length(s));
ScSFTPClient.CloseHandle(Handle);

Post Reply