I'm trying to get a simple file download script working using Net::FTP. Here's my script:
The script seems to run and in fact I can successfully modify it to make and remove directories on the server. What I can't do is get it to download from the server to a local file. Server permissions are set properly, the file exists and the local directory exists. What I get is this error line, and it never gets to the terminating print line.: "Could not get hello.pl from /home/admin/temp Transfer complete. No transfer to ABOR." Can someone point me in the right direction? Joe#!/usr/bin/perl print "Content-type: text/plain\n\n"; use strict; use warnings; use Net::FTP; my $host ='192.168.0.110'; my $user ='root'; my $pw ='xxxxxx'; my $file ='hello.pl'; my $path ='/home/admin/temp'; my $ftp = Net::FTP->new($host, Debug => 1) or die "Could not connect to '$host': $@"; $ftp->login($user, $pw) or die print "Could not login1: %s", $ftp->message; $ftp->cwd($path) or die print "Could not change directory to %spath", $ftp->message +; $ftp->get("hello.pl") or die print "Could not get $file from $path ", $ftp->message; print "End";
In reply to Net::FTP get problem by joedarock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |