NoSignal has asked for the wisdom of the Perl Monks concerning the following question:
The thing that kills me is that time after time, the $ftp->put() operation times out. I can use FTP from the shell and mput my data to the FTP server without any problems. What have I done wrong? Why does this simple code torment me so? I also checked out my glob() by printing the output to screen, and that looks okay. The foreach() also shows that its uploading one file at a time. As an aside, file size ranges between 170Mb and 180Mb per file. Your assistance would be greatly appreciated.# Pattern match all .ipup files in local directory my @files = glob("*.ipup"); # Declare $ftp my $ftp; $ftp = Net::FTP->new($ulservername, Debug => 1, Timeout => 120, Hash = +> \*STDERR) or die "Cannot connect the FTP server called $ulservernam +e.\n"; $ftp->login($username,$password) or die "Authentication on $ulserverna +me failed\n"; $ftp->binary() or die "Could not set BINARY command on $ulservername\n +"; $ftp->cwd($rdirectory) or die "Could change working directory on $ulse +rvername\n"; # Execute the FTP transfer foreach my $file (@files) { print "Copying $file to FTP server...\n"; $ftp->pasv() or die "Could not set PASV command on $ulservername\n" +; $ftp->put($file, $file) or die "Could not transfer $file to FTP ser +ver: $!\n"; } # Send quit to FTP server $ftp->quit() or die "Could not quit the FTP session. Que sera sera\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::FTP insanity
by roboticus (Chancellor) on Nov 22, 2007 at 10:55 UTC | |
|
Re: Net::FTP insanity
by syphilis (Archbishop) on Nov 22, 2007 at 11:15 UTC | |
|
Re: Net::FTP insanity
by NoSignal (Acolyte) on Nov 22, 2007 at 11:31 UTC | |
by syphilis (Archbishop) on Nov 22, 2007 at 11:57 UTC | |
by NoSignal (Acolyte) on Nov 22, 2007 at 12:30 UTC | |
by NoSignal (Acolyte) on Nov 22, 2007 at 11:36 UTC | |
|
Re: Net::FTP insanity
by okram (Monk) on Nov 22, 2007 at 12:39 UTC | |
by NoSignal (Acolyte) on Nov 22, 2007 at 13:02 UTC | |
by DarthFredd (Novice) on Nov 22, 2007 at 17:05 UTC | |
by Gavin (Archbishop) on Nov 22, 2007 at 19:22 UTC |