SSH/SFTP Downloading Text file produces strange characters?

Question: I receive strange characters when downloading a text file using ReadFileText. Why does this happen? Answer: Using SSH/SFTP, files are downloaded exactly as-is byte-for-byte except if you call the ReadFileText* methods. The ReadFileText* methods require a charset (i.e. character encoding) to be specified in the method arguments. This allows the method to interpret the bytes according to a specific […]

SSH / SFTP – Too much time between connect and authentication

The Solution: Issue solved.   The problem was, that we stepped through the code and because of that too much time elapsed between connect and authentication.  As we ran the program without breakpoints it worked. The Problem: The AuthenticatePw method failed and the LastErrorText contained this information: ChilkatLog: AuthenticatePw: DllDate: Jan 31 2010 UnlockPrefix: *** Username: *** Component: .NET 2.0 SshVersion: […]

SFTP File not Found

Question: I’m trying to open a file on the SFTP server, but I get a “File not Found” error? Here is the LastErrorText: ChilkatLog: OpenFile: DllDate: Dec 2 2009 UnlockPrefix: Anything for 30-day trial Username: IUSR_ABC*** Component: ActiveX SshVersion: SSH-2.0-1.36 sshlib: GlobalScape SftpVersion: 3 hcCurDate: Tue, 08 Dec 2009 13:48:25 +0000 hcExpire: 1/2010 filename: test.txt access: writeOnly createDisposition: createTruncate v3Flags: […]

SFTP Permission Denied trying to open existing file.

Question: Why did I get a permission denied error from the server when trying to open an existing file on the SSH/SFTP server? Here’s the LastErrorText: ChilkatLog: DownloadFileByName: DllDate: Dec 2 2009 UnlockPrefix: *** Username: Administrator Component: ActiveX SshVersion: SSH-2.0-CoreFTP-0.1.2 SftpVersion: 3 PreserveDate: 0 fromFilePath: /test.dat.gz toFilePath: c:\abc\test.dat.gz OpenRemoteFile: filename: /test.dat.gz access: readOnly createDisposition: openExisting v3Flags: 0x1 Sent FXP_OPEN StatusResponse: […]

InitializeSftp – Received FAILURE response to subsystem request.

If the SSH server is setup/configured to not allow SFTP, or your SSH user account is not allowed to use SFTP, the InitializeSftp method will return a failed status. Here is an example: ChilkatLog: InitializeSftp: DllDate: Oct 30 2009 UnlockPrefix: ABC123 Username: chilkat Component: .NET 2.0 SshVersion: SSH-2.0-OpenSSH_4.5 SftpVersion: 0 channelType: session clientChannel: 200 initialWindowSize: 327680 maxPacketSize: 32768 Sent open […]

SFTP ReadFileBytes not returning all the data?

Question: I’m just beginning to work with some of the Chilkat components and I’ve run into an apparent issue with the ReadFileBytes method in the ChilkatSFtp component. I’m attempting to read an entire file using ReadFileBytes and only getting part of the file. Here’s essentially what I’m doing: * Use GetFileSize32 to get the size of the file (returns 168914) […]

SFTP Path Syntax

The SFTP protocol does not specify how absolute paths should be formatted.  For example, suppose your SFTP server runs on a Windows system and you wish to open (on the remote server) “C:\Temp\someFile.txt”.   Passing the exact string “C:\Temp\someFile.txt” to OpenFile will likely result in failure.  Different SSH/SFTP servers may expect different path conventions.  To discover what your SFTP server expects, […]

SFTP and SSH: Separate Connections Required?

Question: I have an application using your code that does several SSH and SFTP command during processing. Can I just establish a connection, authenticate passwords and the other setup steps once and then use that connection throughout the program or do I need to perform these steps in every function? If I can do I need a separate connection for […]