Re: WeOnlyDo.Exceptions.SFTP.InvalidStateException - WeOnlyDo Discussion board

Re: WeOnlyDo.Exceptions.SFTP.InvalidStateException (General questions)

by Puja Mallik, Wednesday, March 26, 2008, 19:56 (5884 days ago) @ wodDamir

Puja,

You need to provide absolute paths to files for both, local and remote files. I.e:

ftp1.LocalPath = C: ;
ftp1.RemotePath = /home/user/somefile.txt ;
ftp1.GetFile();

or like this:

ftp1.GetFile( C: , /home/user/somefile.txt );

From the code you sent us I see that you're passing wrong values to the component, which causes the error you are receiving.

Regards,
Damba

===================================================================
Thanks. The above suggesation worked. I have another question. Can I put Getfile method in a loop to retrive multiple files from same directory as an example below
sftp1.LocalPath = C:/Data/xyz ;
foreach (string f in filelist)
{
sftp1.RemotePath = /home/abc/ + f;
sftp1.GetFile();
}


Complete thread: