Downloaded SFTP app [ Renci.SshNet ] from "codeplex" .
Cannot get
sftp.BeginUploadFile( streamparm, targetfilepath)
or
sftp.UploadFile ( streamparm, targetfilepath, null )
to work.
Keep getting "File Not Found" error.
streamparm was created by :
System.IO.Stream streamparm = System.IO.OpenRead("c:\temp\test.csv");
I tried:
string targetfilepath = "sftp://sftp.dfs.com/sfd/test.csv";
string targetfilepath = "sftp.dfs.com/sfd/test.csv";
string targetfilepath = "sfd/test.csv";
sftp.ChangeDirectory("sfd");
string targetfilepath = "test.csv";
Tried using
string targetfilepath = "test.txt";
nothing works catching errors on save(data)
nothing works. Need help.
[ NOTE: sftp.ChangeDirectory("sfd"); . . . and . . . sftp.Create("sfd/test.csv"); . . . works ]
Comments: ** Comment from web user: drieseng **
Cannot get
sftp.BeginUploadFile( streamparm, targetfilepath)
or
sftp.UploadFile ( streamparm, targetfilepath, null )
to work.
Keep getting "File Not Found" error.
streamparm was created by :
System.IO.Stream streamparm = System.IO.OpenRead("c:\temp\test.csv");
I tried:
string targetfilepath = "sftp://sftp.dfs.com/sfd/test.csv";
string targetfilepath = "sftp.dfs.com/sfd/test.csv";
string targetfilepath = "sfd/test.csv";
sftp.ChangeDirectory("sfd");
string targetfilepath = "test.csv";
Tried using
string targetfilepath = "test.txt";
nothing works catching errors on save(data)
nothing works. Need help.
[ NOTE: sftp.ChangeDirectory("sfd"); . . . and . . . sftp.Create("sfd/test.csv"); . . . works ]
Comments: ** Comment from web user: drieseng **
What version of SSH.NET were you using ?
What's your home directory (SftpClient.WorkingDirectory) once you're connected ?
If "sfd" is a subdirectory of your home directory and "test.csv" is located in the "sfd" directory, then this should work just fine:
sftp.ChangeDirectory("sfd");
string targetfilepath = "test.csv";
sftp.UploadFile(streamparm, targetfilepath, null);