Can anyone explain what this means:

Warning: ftp_put(): Illegal PORT command. FTP upload has failed!

    Basically, when you make an FTP connection to a server, your FTP client connects to port 21 on the server. This connection is the 'control' channel for FTP. No data is actually transfered through this port. The control channel allows you to send commands to the FTP server and back while keeping the actual data on a different port. Once the control channel has been setup, then the data channel can be setup and data transfer can be started.

    How the data port is setup depends on which FTP mode you are using. There are two basic modes of operation for an FTP connection 'active' and 'passive'. Essientally, active means that the client tells the server what port it will use for data and passive means that the server will specify what port on the client to use.

    The PORT command is used in active mode for the client to specify which port (on the client) to use for data transfer.

    This is only the basics and I am sure to get flamed by the gods of FTP, but maybe you will have a bit more understanding of FTP now.

    I assume you are using active transfer mode and there is a firewall between your two machines and this is why you are getting that error.

      Thanks for your reply, but I am FTP'ing from a php script. How can I set FTP to passive.

        Thank you very much... your help resolved my problem.

          Write a Reply...