http://qs1969.pair.com?node_id=181480


in reply to Re: Re: Net::FTP via CGI mystery
in thread Net::FTP via CGI mystery

The following extract from the wsftp help might clarify things a little?

Passive Transfers (definition) Normally, when you connect to an FTP site, the site establishes the da +ta connection to your PC (the client). However, if the site allows pa +ssive transfers, you can have your PC establish the data connection. We recommend that you use passive mode for most transfers. Note that p +assive mode may be required for users who are behind some types of ro +uter-based firewalls or behind a gateway requiring passive transfers.

My only thought is that maybe one way is bypassing a proxy/firewall and the other isn't? HTH.

Replies are listed 'Best First'.
Re: Re: Re: Re: Net::FTP via CGI mystery
by George_Sherston (Vicar) on Jul 13, 2002 at 14:07 UTC
    I don't *think* that's the problem, because in both cases the attempt to access the remote ftp server is coming from the same place - namely my script. The only difference is in where I'm calling the script from, as far as I can see. Also, it logs in to the remote ftp server either way I call it. But it seems that, called from the browser, it doesn't send a PASV command to the ftp server. I'm not sure why, or why this is a bad thing. But what I really want to know is... how do I make it work??

    George Sherston
      Call the 'pasv' method before you do your 'ls'.

      What's likely happening is that Net::FTP is doing some configuration based on your user environment, and that environment differs from the environment present when Net::FTP is invoked from within a CGI script. You just don't know it. Be explicit and set 'pasv' if your network/firewall configuration requires that you use it.