Archived Forum Post

Index of archived forum posts

Question:

$rc = $ftp->SendCommand($array[$i],$string);

Jun 09 '16 at 09:20

Why the 500 error?

SendCommand:

DllDate: Dec 29 2015 
ChilkatVersion: 9.5.0.55
UnlockPrefix: *******
Username: 2K7MBS1:LE03964A
Architecture: Little Endian; 32-bit
Language: Windows Perl
VerboseLogging: 0
command: GET BAIEX530,CBFS3922 C:\ftp\banklink\baiexrpt
simpleCommand:
  sendCommand:
    sendingCommand: GET BAIEX530,CBFS3922 C:\ftp\banklink\baiexrpt
  --sendCommand
  readCommandResponse:
    replyLineQP: 500 Syntax error, command unrecognized.
  --readCommandResponse
--simpleCommand
statusCode: 500
Failed.

--SendCommand --ChilkatLog


Answer

  1. The SendCommand can only be used for commands where the result is just a reply on the command/control connection. It seems like you're trying to download a file, but that's not possible because FTP sends the file on a separate data connection.
  2. You're confusing the commands of an FTP console application vs. the commands of the FTP protocol. Let's say you start a DOS prompt and type the "ftp" command, and then begin entering commands at the FTP prompt, such as "ls", "cd", "get", etc. These are the human-interface commands to the FTP client application. The actual commands that get sent to the FTP server are the FTP protocol commands. These are specified in RFC 959 (https://tools.ietf.org/html/rfc959) as well as in many RFC's for FTP protocol extensions.

Answer

certainly makes sense. Thanks.