Hello, We are running into an error "No Such File" error trying to upload files using SFTP. The file does NOT get uploaded. Below is my code and logs.
[code]
{
SecureFTPConnection.LogLevel = EnterpriseDT.Util.Debug.LogLevel.All;
SecureFTPConnection.LogFile = @"C:\EdtPro\logs\log.txt";
SecureFTPConnection sftpConnection = new SecureFTPConnection();
sftpConnection.ServerAddress = host;
sftpConnection.UserName = _login;
sftpConnection.Password = _password;
sftpConnection.Protocol = FileTransferProtocol.SFTP;
sftpConnection.ServerValidation = SecureFTPServerValidationType.None;
sftpConnection.LicenseOwner = GetSftpLicenseOwner();
sftpConnection.LicenseKey = GetSftpLicenseKey();
sftpConnection.Connect();
// Store the sftpConnection in the object that we pass into the
// asynchronous operations.
state.SftpConnection = sftpConnection;
state.Data = fileContents;
// Get the event to wait on.
waitObject = state.OperationComplete;
sftpConnection.BeginUploadByteArray(fileContents, path, new AsyncCallback(EndBeginUploadByteArrayCallback), state);
}
}
[code]private static void EndBeginUploadByteArrayCallback(IAsyncResult ar)
{
FtpState state = (FtpState)ar.AsyncState;
SecureFTPConnection sftpConnection = state.SftpConnection;
try
{
sftpConnection.EndUploadByteArray(ar);
state.StatusDescription = (sftpConnection.LastValidReply != null ? sftpConnection.LastValidReply.ReplyText : string.Empty);
sftpConnection.Close();
// Signal the main application thread that
// the operation is complete.
state.OperationComplete.Set();
if (state.Helper.OperationCompleted != null)
{
state.Helper.OperationCompleted(null, new OperationCompletedEventArgs(state.StatusDescription));
}
}
catch (Exception e)
{
state.OperationException = e;
state.OperationComplete.Set();
throw;
}
if (waitForComplete)
waitObject.WaitOne();
if (state.OperationException != null)
{
throw Logging.Logger.LogAndReturnFault(
new Contract.Fault.ConnectionFault(Contract.Fault.ConnectionFailureReason.OperationException, state.OperationException.Message), baseRequest);
}[/code][/code]
I tried using:
sftpConnection.ServerCompatibility = SecureFTPCompatibilityFlags.SSHDisableChmodAfterPut;
but that did not help either. We are using version edtFTPnetPRO version 7.3.1.20
Your help will be appreciated. Thanks
Here are the logs:
ALL [FTPConnectionPool] 5 Jun 2015 08:12:04.556 : Freed master connection 0 - 0
ALL [FTPTaskProcessor] 5 Jun 2015 08:12:04.560 : Exiting RunTask on connection 0
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.556 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 5 Jun 2015 08:12:04.560 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
INFO [LicenseProperties] 5 Jun 2015 08:12:04.560 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 5 Jun 2015 08:12:04.560 : Production license
DEBUG [FTPConnection] 5 Jun 2015 08:12:04.560 : Set LocalDirectory='c:\window