http://www.perlmonks.org?node_id=181483


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

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
  • Comment on Re: Re: Re: Re: Net::FTP via CGI mystery

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Net::FTP via CGI mystery
by Fastolfe (Vicar) on Jul 13, 2002 at 16:41 UTC
    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.