EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElSimpleSFTPClient File Errors

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#21134
Posted: 08/22/2012 12:32:37
by Steve Oswald (Basic support level)
Joined: 08/22/2012
Posts: 3

Hello,

Implementing the SFTP client, and I am getting the following error when sending:

"File system operation failed with error (error code is 103426)"

Here is my code:

Code
Client = New TElSimpleSFTPClient
Client.Address = _FTPLocation
Client.Port = 22
Client.Username = _FTPUsername
Client.Password = _FTPPassword
AddHandler Client.OnKeyValidate, AddressOf m_Client_OnKeyValidate
Client.Open()
Client.OpenDirectory("\to_hh")
Client.LocalAddress = System.IO.Path.GetDirectoryName(_FilesCreated(FileLooper))
Client.UploadFile(RootName, RootName, SBUtils.TSBFileTransferMode.ftmOverwrite)


Any help would be greatly appreciated!
#21135
Posted: 08/22/2012 12:35:16
by Eugene Mayevski (EldoS Corp.)

This error can happen if you try to use Mono assemblies of SecureBlackbox 9 on Windows. These assemblies are only for Unix-like platforms. In version 10 we have improved Mono assemblies to detect Windows and not produce the above (and similar) error. But still it makes sense to use .NET assemblies on Windows.


Sincerely yours
Eugene Mayevski
#21136
Posted: 08/22/2012 12:37:49
by Eugene Mayevski (EldoS Corp.)

Emm, looks like it's not the case for you. The code itself makes no sense. First of all, OpenDirectory call is not needed (you can safely remove it). Next, setting LocalAddress is non-sense (partially because LocalAddress is for IP address to bind to. Finally, you need to specify proper file name in UploadFile method. And you put remote file name as local.

I suggest that you review sample projects attentively before writing your code - they rule.


Sincerely yours
Eugene Mayevski
#21137
Posted: 08/22/2012 12:43:29
by Steve Oswald (Basic support level)
Joined: 08/22/2012
Posts: 3

If I do not use OpenDirectory, then do I specify the local file name as a full path?

Also, when I did not have the LocalAddress property, I got a "File not found" error, which went away after using it.

This is a console application, and the example uses all parameters, so I do not have access to the assumptions made about the content of those parameters.
#21138
Posted: 08/22/2012 12:50:04
by Steve Oswald (Basic support level)
Joined: 08/22/2012
Posts: 3

I have resolved the issue. With no OpenDirectory, or LocalAddress, the file transfers work if I specify the destination folder as part of the remote file name.

Thank you for your assistance!
#21139
Posted: 08/22/2012 13:03:21
by Eugene Mayevski (EldoS Corp.)

You always specify full paths - SFTP knows nothing about "current directory" (unlike FTP which does have CD command). And LocalAddress property is completely unrelated - it specifies a network interface to bind the socket to on the local system.


Sincerely yours
Eugene Mayevski
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 3201 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!