Hello Fabrice,

I can send you login and password to test on a private mail if you want.
This FTP server (Filezilla) work fine with a filezilla client.

I have received it and I was able to test your FTP server.
I can reproduce the error and found what the error is. It was shown in all your messages from start but I didn't noticed it ! The answer for PASV command is wrong. The answer starts with the code "27" while it should start with code "227".
Your server replies:
      < 27 Entering Passive Mode (213,56,128,2,5,95)
While it should reply:
      < 227 Entering Passive Mode (213,56,128,2,5,95)

The component expect response code 227 which never comes. It may work with other FTP client which do not check the response as ICS does. I checked with FileZilla client which also obviously receive the "27" response but it is accepted.

This is defenitely not a problem with ICS but from YOUR SERVER. You should find out why your server has a bad answer to the PASV command.
Maybe you have edited the the message file of your server ?

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


----- Original Message ----- From: "Fabrice Vendé" <techni...@infocob.com> To: "ICS support mailing" <twsocket@elists.org>; "Technique INFOCOB" <techni...@infocob.com>
Sent: Thursday, May 12, 2011 6:26 PM
Subject: Re: [twsocket] TFtpCli and FTP server in passive mode


Le 12/05/2011 17:42, Francois PIETTE a écrit :
I have tested your code and it works perfectly from here.
Here is the log using YOUR code and ICS-V7 updated form SVN repository right now:

I have downloaded and installed the last update (http://wiki.overbyte.be/arch/icsv7w.zip) on my Delphi 2010.
And I have exactly the same problem.
TftpClient.put seems to be ignored.

The differences between your test and mine are:
1) I updated my ICS source code from SVN reporistory (I mean using SVN client, not downloading the snapshot). Should not make any difference.
2) I'm using Delphi XE.
3) I made a small application while it looks this is part of a larger application.

I have just tested on Delphi XE with exactly the same result !


I'am using ICS (FTP, http and Tsmtp) components since more than 10 years
I have no problem on FTP server which allows Active mode.
This new problem is only in Passive mode.

Since something wrong from the large application could corrupt code anywhere, I suggest you build a new trivial application with the code and try it alone.

You may also try the demo application FtpTst provided with ICS.
Already tested with same problem.


Since what you want to do is so basic, it is extremely improbable that you found a bug in ICS. There must be something special on your computer. Maybe a path problem where you use an old ICS version ? Maybe some dcu floating around ? Also maybe there is a bug in Delphi 2010. Have you installed all updates ?
I have tried on Delphi 2006 and Delphi 2010 in ICS version 6 and ICS
Version 7 and last  daily Build.
On Delphi XE with last Daily build.
My Delphi 2006 and 2010 are not on the same computer. My Delphi 2006 is
on a Windows 7 pro 32 bits.
My Delphi 2010 and Delphi XE are on the same computer (Windows 7 pro 64
bits).



I have tried another way I do this :
procedure TForm8.icsClick(Sender: TObject);
begin
   FtpClient1.HostName:=site.text;
   FtpClient1.username:=login.text;
   FtpClient1.password:=password.text;

   FtpClient1.Passive:=true;
   FRunning:=true;
   FtpClient1.connect;

end;


And use event OnRequestDone :

procedure TForm8.FtpClient1RequestDone(Sender: TObject; RqType: TFtpRequest;
  ErrCode: Word);
begin

     if (ErrCode > 0) and  (ErrCode < 10000) then
     begin
        FlastErreur:='Requete effectuée Rq=' + IntToStr(Ord(RqType)) +
                ' Erreur='+ FtpClient1.ErrorMessage;
        AjouterLog(FlastErreur);
     end
     else
     begin
        FlastErreur:= 'Requete effectuée Rq=' + IntToStr(Ord(RqType)) +
                ' Erreur='+ IntToStr(ErrCode);
        AjouterLog(FlastErreur);
        if ErrCode=0 then FlastErreur:='';
     end;

    if not FRunning then
        Exit;


    case RqType of
    ftpConnectAsync: begin
                      ftpclient1.User;
                  end;
    ftpUserAsync:      ftpclient1.pass;
    ftpPassAsync:
                begin
                    ftpclient1.HostDirName:='.';
                    ftpclient1.Cwd;
                end;
    ftpCwdAsync:    begin
                      FtpClient1.LocalFileName    :='h:\test.txt';
                      FtpClient1.HostFileName    :='test.txt';
                      ftpclient1.put;
                     end;
    ftpPutAsync: ftpclient1.Quit;
    ftpQuitAsync:     begin
                      AjouterLog('Effectuée !');
                      FRunning := FALSE;
                  end;
    end;

end;


But I have exactly the quasi the same problem, but that is new it that I
get an ErrCode=27 :
Log are :

< 220-FileZilla Server version 0.9.37 beta
< 220-written by Tim Kosse (tim.ko...@gmx.de)
< 220 Please visit http://sourceforge.net/projects/filezilla/
USER cob
> USER cob
FTP component already connected
< 331 Password required for cob
Requete effectuée Rq=5 Erreur=0
USER username
> USER username
< 331 Password required for username
Requete effectuée Rq=2 Erreur=0
PASS **********
> PASS *******
< 230 Logged on
Requete effectuée Rq=3 Erreur=0
CWD .
> CWD .
< 250 CWD successful. "/" is current directory.
Requete effectuée Rq=4 Erreur=0
PASV
> PASV
< 27 Entering Passive Mode (213,56,128,2,5,95)
Requete effectuée Rq=18 Erreur=27 Entering Passive Mode (213,56,128,2,5,95)
QUIT
> QUIT
<
< 221 Goodbye
Requete effectuée Rq=15 Erreur=0
Effectuée !


What means ErrCode= 27 ?

Put command is handled but become an Pasv command...

I can send you login and password to test on a private mail if you want.
This FTP server (Filezilla) work fine with a filezilla client.



--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

-
Fabrice

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to