EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElSimpleSFTPClient & "No such file"

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#11242
Posted: 10/06/2009 08:02:48
by Nigel Jewell (Basic support level)
Joined: 10/06/2009
Posts: 2

Hi all,

I am trialling the SecureBlackbox SFTP components and I've hit a snag. If I try to upload a file to my local OpenSSH SFTP server it works fine, but when I try to upload the same file to a third-parties server I get the error "No such file". Any ideas on where to start in order to resolve this? The remote SFTP server is: SSH-2.0-1.82 sshlib: sshlibSrSshServer 1.00.

Regards,
Nige.

Quote
SBSftpCommon.EElSFTPError: No such file.
at SBSftp.TElSftpClient.OpenFileSync(String Filename, Int32 Modes, TElSftpFileAttributes Attributes)
at SBSimpleSftp.TElSimpleSFTPClient.OpenFile(String Filename, Int32 Modes, TElSftpFileAttributes Attributes)
at SBSimpleSftp.TElSimpleSFTPClient.UploadStream(Stream LocalStream, String RemoteFileName, TSBSFTPFileTransferMode Mode, Int64 RestartFrom)
at SBSimpleSftp.TElSimpleSFTPClient.UploadFile(String LocalFileName, String RemoteFileName, TSBSFTPFileTransferMode Mode, Int64 RestartFrom)
at SBSimpleSftp.TElSimpleSFTPClient.UploadFile(String LocalFileName, String RemoteFileName, TSBSFTPFileTransferMode Mode)
at SBSimpleSftp.TElSimpleSFTPClient.UploadFile(String LocalFileName, String RemoteFileName)
#11245
Posted: 10/06/2009 08:15:01
by Ken Ivanov (EldoS Corp.)

Thank you for contacting us.

Can you please check if the same issue occurs with the sample application (SimpleSFTPDemo)?
#11247
Posted: 10/06/2009 08:27:46
by Eugene Mayevski (EldoS Corp.)

First of all ensure that you pass the absolute path to file in RemoteFileName, and that this path exists on the server. Wrong path is the most likely reason of the problem.


Sincerely yours
Eugene Mayevski
#11248
Posted: 10/06/2009 08:41:40
by Nigel Jewell (Basic support level)
Joined: 10/06/2009
Posts: 2

Thanks for your responses. It appears that there was an SFTP version mismatch. Adding the following has resolved the problem.

Code
sftpClient.Versions = SBSftpCommon.__Global.sbSFTP3;


Kind Regards,
Nige.
#12736
Posted: 03/08/2010 18:01:48
by bsa Ambekar (Basic support level)
Joined: 03/08/2010
Posts: 4

I am getting similar error for uploading file to the ftp site using SSH as below

SBSftpCommon.EElSFTPError: No such file
at SBSftp.TElSftpClient.CreateFileSync(String Filename)
at SBSimpleSftp.TElSimpleSFTPClient.CreateFile(String Filename)
at sFtp.sFtpClient.SendFile(String fileToSend)

Could some one please guide me how to resolve it?

Thanks
bsa
#12738
Posted: 03/08/2010 22:54:04
by Ken Ivanov (EldoS Corp.)

Thank you for contacting us.

Does the UploadFile() (or UploadStream() if you are dealing with streams) method work as expected?
#12745
Posted: 03/09/2010 11:21:44
by bsa Ambekar (Basic support level)
Joined: 03/08/2010
Posts: 4

I tried using both methods:UploadStream, UploadFile and getting following errors


Error using UploadStream():

SBSftpCommon.EElSFTPError: No such file
at SBSftp.TElSftpClient.OpenFileSync(String Filename, Int32 Modes, TElSftpFileAttributes Attributes)
at SBSimpleSftp.TElSimpleSFTPClient.OpenFile(String Filename, Int32 Modes, TElSftpFileAttributes Attributes)
at SBSimpleSftp.TElSimpleSFTPClient.UploadStream(Stream LocalStream, String RemoteFileName, TSBSFTPFileTransferMode Mode)
at sFtp.sFtpClient.SendFile(String fileToSend)


Error using UploadFile ():

SBSftpCommon.EElSFTPError: No such file
at SBSftp.TElSftpClient.OpenFileSync(String Filename, Int32 Modes, TElSftpFileAttributes Attributes)
at SBSimpleSftp.TElSimpleSFTPClient.OpenFile(String Filename, Int32 Modes, TElSftpFileAttributes Attributes)
at SBSimpleSftp.TElSimpleSFTPClient.UploadStream(Stream LocalStream, String RemoteFileName, TSBSFTPFileTransferMode Mode)
at SBSimpleSftp.TElSimpleSFTPClient.UploadFile(String LocalFileName, String RemoteFileName, TSBSFTPFileTransferMode Mode)
at sFtp.sFtpClient.SendFile(String fileToSend)

Thanks
bsa
#12748
Posted: 03/09/2010 11:51:32
by bsa Ambekar (Basic support level)
Joined: 03/08/2010
Posts: 4

I am able to Connect and upload files with FileZilla.

Also I tried with SimpleSFTPDemo and Client (available in Samples for ELDOS) and getting following errors:

Error with SimpleSFTPDemo

SBSimpleSftp.EElSimpleSFTPClientException: Connection failed
at SBSimpleSftp.TElSimpleSFTPClient.Open()
at SimpleSftpDemo.frmMain.Connect() in C:\Program Files\EldoS\SecureBlackbox.NET\Samples\VB.NET\SFTPBlackbox\SimpleSFTPDemo\Form1.vb:line 421


Error with Client

System.Net.Sockets.SocketException: The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for
at System.Net.Dns.GetHostByName(String hostName)
at System.Net.Dns.Resolve(String hostName)
at Client.frmMain.cmdConnect_Click(Object sender, EventArgs

Thanks,
bsa
#12751
Posted: 03/09/2010 12:25:10
by Eugene Mayevski (EldoS Corp.)

With the samples it looks like you are providing wrong information in the destination address.

As for your code - please show us the exact value of LocalFileName and RemoteFileName parameters that you pass to UploadStream method.


Sincerely yours
Eugene Mayevski
#12753
Posted: 03/09/2010 13:11:22
by bsa Ambekar (Basic support level)
Joined: 03/08/2010
Posts: 4

Here is how I am using UploadStream

stream = new System.IO.FileStream( fileToSend, FileMode.Open, FileAccess.Read, FileShare.Read );
shortName = System.IO.Path.GetFileName( fileToSend );
m_client.UploadStream(stream, shortName,0);

Where:
LocalFileName (fileToSend): @"c:\Test-7.txt"
RemoteFileName (shortName): "Test-7.txt"

Thanks
bsa
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 7606 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!