login about faq

Hello, I recently replaced the original programmer who used Chilkat to process FTP requests.

Their code, which was copied verbatim from the website, was slightly altered as follows:

success = sftp.DownloadFileByName(remoteFilePath, localFilePath)
If (success <> True) Then Throw New System.Exception(sftp.LastErrorText)

If File.Exists(localFilePath) Then File.Copy(localFilePath, archiveFilePath, True)

success = sftp.RemoveFile(absPath & "/" & fileObj.Filename)
If (success <> True) Then Throw New System.Exception(sftp.LastErrorText)

On July 17th, we received a call from an upset customer who wanted to know why their file wasn't processed. Upon investigation. it looks as though the file was removed from the FTP without a local copy present.

In addition, I received two of the following error messages:

    DllDate: Mar 20 2017
    UnlockPrefix: [removed by me]
    Architecture: Little Endian; 32-bit
    Language: .NET 4.0
    VerboseLogging: 0
    SshVersion: SSH-2.0-CerberusFTPServer_8.0 FIPS
    SftpVersion: 3
      remotePath: [removed by me]
        Request: FXP_REMOVE
          StatusCode: 22

We have full read/write/delete rights on the FTP server. I added the exception handling (which was previously the "console.writeline" as was in the code example) and these messages are quite frequent now.

QUESTION: the line "sftp.DownloadFileByName" - is the success check that follows a COMPLETION of the download file or that it is downloading the file?

I need to know quickly because apparently, this wasn't the first time. The programmer used the Chilkat code example verbatim, and this why no one noticed before.

The documentation is... too sparse to make a determination.

Thanks for the help.

asked Aug 04 '17 at 14:56

ChooseScreenName's gravatar image


edited Aug 05 '17 at 13:07

jpbro's gravatar image

jpbro ♦

When DownloadFileByName returns true, the file is completely downloaded to your local path. There are "....Async" methods that return when the download is initiated, but you are not using them.


answered Aug 04 '17 at 23:42

Gert's gravatar image

Gert ♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Aug 04 '17 at 14:56

Seen: 1,411 times

Last updated: Aug 05 '17 at 13:07

powered by OSQA