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

Hello Everyone;
I am no doubt a beginner, I have tried many methods of FTP and still no success. The result: the file name(450k-.txt)is created on Windows FTP Server but no data in the file(contents) is transferred. Any one have a creative idea ??? Need help as my job relies on this... thanks
#!/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();

Edit by tye

Replies are listed 'Best First'.
Re: FTP
by derby (Abbot) on Aug 21, 2002 at 17:09 UTC
    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();
      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