perl_help26 has asked for the wisdom of the Perl Monks concerning the following question:

Hello :)

I am trying to send a file through ftp from my machine to a virtual Xlight FTP server. The files are indeed sent to the ftp server BUT they are empty. I want to know if this something to do with the FTP code I am using:

my $ftp = Net::FTP->new($xlight_server_ip, Debug => 0) or log_error +("Cannot connect") ; $ftp->login($user,$pass) or log_error ("Cannot login ") ; $ftp->cwd($dest_dir) or log_error ("Cannot change working directory ") + ; $ftp->put($file_to_send);

Any ideas??? Thanks

Replies are listed 'Best First'.
Re: Net::FTP with Xlight FTP server
by marto (Cardinal) on Apr 16, 2015 at 10:56 UTC
Re: Net::FTP with Xlight FTP server
by hippo (Archbishop) on Apr 16, 2015 at 10:57 UTC

    Well that could be almost anything (permissions, quota, active v passive, etc.). But, if you are trying to debug the problem I would strongly recommend against setting Debug => 0 as you have done. Try some positive value instead and see if that makes the reason clear.

    Of course, if you have access to the server's FTP logs then that's another good place to look.

      Thank you for your response.

      I've done additional testing and I noticed the following:

      - if I run the perl script from my local machine, the files are uploaded to the virtual server successfully.

      - If I run the perl script from a virtual box on my machine, the files are sent BUT they are EMPTY. The ftp message just says "Opening Binary mode data connection..." but without transfer complete.

      If I am correct:

      - it has nothing to do with permission rights since i am using the same user

      - firewall is allowing all File transfer protocols.

      What could it be? Thank you

        Check PASSIVE versus ACTIVE mode.

        Dum Spiro Spero