Re: TIdFTP.ChangeDir problem

Giganews Newsgroups
Subject: Re: TIdFTP.ChangeDir problem
Posted by:  Don Siders (mudsha…
Date: Wed, 17 Nov 2004

> I am getting an AErrCode of 220 when the following line of code executes
> against a server running ProFTPD1.2.9

> procedure TIdFTP.ChangeDir(const ADirName: string);
> begin
>  SendCmd('CWD ' + ADirName, [200, 250]); //APR: Ericsson Switch FTP    {Do
> not translate}
> end;

> It appears that 220 is a good return code, do I just add the code like this
> SendCmd('CWD ' + ADirName, [200, 220,250]); //APR: Ericsson Switch FTP
> {Do not translate}

220 is not a valid response for CWD, according to RFC 959:

    Success: 250
    Error: 500, 501, 502, 421, 530, 550

Indy includes the 200 response code for the reason indicated in the comment, but it really shouldn't be there (IMO).  You can modify your copy of the code as you'd like.  But future Indy updates will not have your customizations.

And, yes... including the code in the array of success responses is all that should be required.

Does the 220 response you're getting have any text attached?


In response to

TIdFTP.ChangeDir problem posted by Stephen Hauck on Wed, 17 Nov 2004