I am using the below code to connect and put the file under sftp server
public void SFTPPutFiles()
{
Sftp SFTPConnection = null;
try
{
SFTPConnection = new Sftp(_FTPServer, _FTPUserId, _FTPPassword);
SFTPConnection.Connect();
SFTPConnection.Put(_LocalFilePath);
}
catch (Exception ex)
{
clsError.WriteError("SFTPPutFiles", ex);
}
}
I am geting the below error when I try to run the exe with the parametrs ftp server name,userid,password and the local file path
Error Message: Exception of type 'Tamir.SharpSsh.jsch.SftpException' was thrown.
Error Stack: at Tamir.SharpSsh.jsch.ChannelSftp.put(String src, String dst, SftpProgressMonitor monitor, Int32 mode)
at Tamir.SharpSsh.Sftp.Put(String fromFilePath, String toFilePath)
at Tamir.SharpSsh.Sftp.Put(String fromFilePath)
at SFTPClient.clsFTP.SFTPPutFiles()
It looks like there is some problem with the put function.Is it due to some user rights.
This use to work fine before till the sftp site changes and I had to change the
sftp sitename and credential.Please help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-06-29
Hi,
I was facing the same problem, but it is resolved when I set the correct
Sftp sftpClient = new Sftp(SFTPHost, SFTPUser, SFTPPassword);
sftpClient.Connect();
sftpClient.Put(filePath, remoteFolder);
//remoteFolder - /data/home/bsssftp/out/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using the below code to connect and put the file under sftp server
public void SFTPPutFiles()
{
Sftp SFTPConnection = null;
try
{
SFTPConnection = new Sftp(_FTPServer, _FTPUserId, _FTPPassword);
SFTPConnection.Connect();
SFTPConnection.Put(_LocalFilePath);
}
catch (Exception ex)
{
clsError.WriteError("SFTPPutFiles", ex);
}
}
I am geting the below error when I try to run the exe with the parametrs ftp server name,userid,password and the local file path
Error Message: Exception of type 'Tamir.SharpSsh.jsch.SftpException' was thrown.
Error Stack: at Tamir.SharpSsh.jsch.ChannelSftp.put(String src, String dst, SftpProgressMonitor monitor, Int32 mode)
at Tamir.SharpSsh.Sftp.Put(String fromFilePath, String toFilePath)
at Tamir.SharpSsh.Sftp.Put(String fromFilePath)
at SFTPClient.clsFTP.SFTPPutFiles()
It looks like there is some problem with the put function.Is it due to some user rights.
This use to work fine before till the sftp site changes and I had to change the
sftp sitename and credential.Please help
Hi,
I was facing the same problem, but it is resolved when I set the correct
Sftp sftpClient = new Sftp(SFTPHost, SFTPUser, SFTPPassword);
sftpClient.Connect();
sftpClient.Put(filePath, remoteFolder);
//remoteFolder - /data/home/bsssftp/out/