Delphi Example Code (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Bret @, (7178 days ago)

The example code for the SFTP is too basic. I'm stuck in trying to waitfor events to finish.

I am looking for a more robust example that shows how to do more than one thing in procedure. for example:

begin
wodSFTP1.listNames;
wodSFTP1.putfile(FileName);
end;

The above lines will fail on PutFile() as ListNames has not completed.

Any help appreciated.

Email: bee ohh bee at 'bordwell.com' (those are read as: bob)

locked

Re: Delphi Example Code

by Jasmine, (7178 days ago) @ Bret

Bret,

the way you use it (sequentially, line per line..) you need to set Blocking property to True and it will work. Currently component works in async way and you cannot execute methods until previous completes. Blocking should solve that. Can you try?

locked

Re: Delphi Example Code

by Bret @, (7178 days ago) @ Jasmine

Excellent, Thank You!

Now, Another problem

The following fails:

var
FileName : OleVariant;
begin
wodsftp1.ListNames;
FileName := 'c:file1.txt';
wodsftp1.PutFile(FileName);
FileName := 'C:file2.txt';
wodsftp1.PutFile(FileName);
end;

What happens is file1.txt gets sent, then file1.txt gets sent again, as if FileName is not being re-set. Have tried as seperate OleVariants (FileName1,FileName2 : OleVariant), but that fails too.

Thanks again for your earlier suggestion.

Bret,

the way you use it (sequentially, line per line..) you need to set Blocking property to True and it will work. Currently component works in async way and you cannot execute methods until previous completes. Blocking should solve that. Can you try?

locked

Re: Delphi Example Code

by Jasmine, (7178 days ago) @ Bret

Bret,

you didn't specify RemotePath, and (I assume) it's the same in both cases.

Also, please use absolute paths *always*, not relative.

Regards,
Kreso

locked

Re: Delphi Example Code

by Bret, (7178 days ago) @ Jasmine

Thats It! Thank you!

Love your tech support... oooh so fast!

locked