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:

    ChilkatLog:
  RemoveFile:
    DllDate: Mar 20 2017
    ChilkatVersion: 9.5.0.66
    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
    removeFile:
      remotePath: [removed by me]
      StatusResponseFromServer:
        Request: FXP_REMOVE
        InformationReceivedFromServer:
          StatusCode: 22
          StatusMessage: 
        --InformationReceivedFromServer
      --StatusResponseFromServer
    --removeFile
    Failed.
  --RemoveFile
--ChilkatLog

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 at 14:56

ChooseScreenName's gravatar image

ChooseScreenName
1

edited Aug 05 at 13:07

jpbro's gravatar image

jpbro ♦
1.1k2618


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.

link

answered Aug 04 at 23:42

Gert's gravatar image

Gert ♦
684141825

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×227

Asked: Aug 04 at 14:56

Seen: 143 times

Last updated: Aug 05 at 13:07

powered by OSQA