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 […]

SFTP Append to Existing File

To append to an existing file using the Chilkat SFTP component / library, open the file for “writeOnly” and “openExisting”, then call any of the Write* methods (such as WriteFileText or WriteFileBytes), and then close the handle by calling CloseHandle. As always, if a method returns a failed status, check the contents of the LastErrorText property.

SFTP Progress Monitoring and Abort (C#)

Here is an example for monitoring the progress of an SFTP file transfer: void sftp_OnPercentDone(object sender, Chilkat.PercentDoneEventArgs args) { progressBar1.Value = args.PercentDone; // To abort at any point, you may set args.Abort = true // args.Abort = true; } void sftp_OnAbortCheck(object sender, Chilkat.AbortCheckEventArgs args) { // See https://cknotes.com/?p=149 for more information about // using the AbortCheck event… } private void […]