EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Using SFTP can read directory list but cannot move files

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#9665
Posted: 04/12/2009 06:47:31
by Simon James (Basic support level)
Joined: 03/27/2009
Posts: 5

Hello,
I'm having problems using the SFTP. When i use the ListDirectory() method everything works fine. When i try to use DownloadFile() I get a blank error. This is the stack trace:

Quote
SBSftpCommon.EElSFTPError at SBSftp.TElSftpClient.OpenFileSync(String Filename, Int32 Modes, TElSftpFileAttributes Attributes) at SBSimpleSftp.TElSimpleSFTPClient.OpenFile(String Filename, Int32 Modes, TElSftpFileAttributes Attributes) at SBSimpleSftp.TElSimpleSFTPClient.DownloadStream(String RemoteFileName, Stream LocalStream, TSBSFTPFileTransferMode Mode, Int64 RestartFrom) at SBSimpleSftp.TElSimpleSFTPClient.DownloadFile(String RemoteFileName, String LocalFileName, TSBSFTPFileTransferMode Mode, Int64 RestartFrom) at SBSimpleSftp.TElSimpleSFTPClient.DownloadFile(String RemoteFileName, String LocalFileName, TSBSFTPFileTransferMode Mode) at ClassLibrary1.SFTPClient.RetrieveFile(String fileName)


Is this a permissions issue? If so do i have to give the folder specific user permissions or is it the FTP account that needs special permissions? As far as i know the virtual ftp account i'm using has read/write.

Simon
#9667
Posted: 04/12/2009 07:05:18
by Eugene Mayevski (EldoS Corp.)

Thank you for contacting us.

To help us identify the problem, please answer the following questions:

1) Does the problem happen with the sample application too? Try downloading the file using one of the sample applications and see what error is reported or what exception is fired.
2) what *exactly* value you pass in RemoteFileName and in LocalFileName parameters?
3) The Message property of the exception object should contain some text. What text do you see there?


Usually if the protocol error happens, the server sends an error and this error is reported using OnError event. This doesn't happen always though (in some cases the server just closes connection) but this doesn't seem to be the case. So please answer the above questions.


Sincerely yours
Eugene Mayevski
#9674
Posted: 04/13/2009 08:25:54
by Simon James (Basic support level)
Joined: 03/27/2009
Posts: 5

I did as you said and tried the demo app and now i'm recieving another new error with both the demo and my app. I've been working on a lot at the moment so i'm not sure what it was i changed to create the new error.

Quote
System.ArgumentNullException: Value cannot be null. Parameter name: path at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity) at System.IO.Directory.CreateDirectory(String path) at SBSimpleSftp.TElSimpleSFTPClient.CreateLocalFolder(String RootName, String DirName) at SBSimpleSftp.TElSimpleSFTPClient.DownloadFile(String RemoteFileName, String LocalFileName, TSBSFTPFileTransferMode Mode, Int64 RestartFrom) at SBSimpleSftp.TElSimpleSFTPClient.DownloadFile(String RemoteFileName, String LocalFileName, TSBSFTPFileTransferMode Mode) at ClassLibrary1.SFTPClient.RetrieveFile(String fileName)


The paramters i used in the DownloadFile method are as follows:
Code
client.DownloadFile(_currentPath + fileName, "new" + fileName, TSBSFTPFileTransferMode.ftmOverwrite);


_currentPath + fileName = "/Outgoing/EOD.XML"
"new" + fileName = "newEOD.XML"

the file name is correct as it's found by the ListDirectory method correctly.

Simon
#9675
Posted: 04/13/2009 08:48:04
by Simon James (Basic support level)
Joined: 03/27/2009
Posts: 5

I figured it out in the end. Used the wrong local name

Reply

Statistics

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