in reply to Net::FTP creates empty file

doesntmatter,

I gave you the wrong advice with "Unsuccessful transfer: $@\n" go back to Re: NET::FTP Problem and also read Beginners guide to Net::FTP. Also, just for grins, can you do this ftp manually?

-derby

ps please use code tags, it's hard to read your question without them.

#!/D:/perl/bin/-w # a module making life easier use strict; use Net::FTP; my $destserv="ftp.somewhere.com"; my $user="user"; my $password="password"; my $dir = "/my/directory"; my $file_to_put = "ftptest2.txt"; my $ftp = Net::FTP->new($destserv) or die "Can't Open $destserv\n"; $ftp->login($user,$password); $ftp->cwd($dir) or die "Can't cwd to $dir\n"; $ftp->ascii(); $ftp->pasv(); $ftp->put($file_to_put) or die "Unsuccessful transfer:$@\n"; $ftp->quit();

Replies are listed 'Best First'.
Re: Re: FTP
by doesntmatter (Initiate) on Aug 21, 2002 at 17:23 UTC
    Thanks Derby... Yes I can do it manually and have been.. I have read the beginners guide and followed it to the letter.. I have also tried other guides.. same problem, the bits in the file don't transfer..
      Use the full power of Net::FTP to trace the connection:

      my $ftp = Net::FTP->new($destserv, Debug => 1 ) or die "Can't Open $de +stserv\n";

      And see what types of interesting things pop up.

      -derby