RPrinceton
Programmer
Hi everyone,
I am trying to FTP a file from a directory on my website to my HDD using Net::FTP in a Perl script. I have a file server running on my PC. I can successfully do a file delete and mkdir using the script, so this proves the integrity of connectivity and drive access. The problem comes in when I try to FTP i.e., put or get an actual file. I believe it has something to do with the path. I have further deduced that it is the file path to the file on the website and that somehow the script is unable to locate the file or something of that nature. I receive an error message "Cannot open data connection". I really thing this means "Cannot find file". I have included a portion of the code below. Please advise. Thx in advance.
Regards,
RPrinceton
use Net::FTP;
Making a new directory works using this code:
$ftp = Net::FTP->new("EIS", Debug => 0) or die "Cannot connect to EIS: $@";
$ftp->login("WBSFP",'??????') or die "Cannot login ", $ftp->message;
$ftp->cwd("C:\\") or die "Cannot change working directory ", $ftp->message;
$ftp->mkdir("newdir") or die "Cannot make new directory ", $ftp->message;
$ftp->quit;
Deleting a file on my C drive works using this code:
$ftp = Net::FTP->new("EIS", Debug => 0) or die "Cannot connect to EIS: $@";
$ftp->login("WBSFP",'??????') or die "Cannot login ", $ftp->message;
$ftp->cwd("C:\\") or die "Cannot change working directory ", $ftp->message;
$ftp->delete("abc.txt") or die "Cannot delete file ", $ftp->message;
$ftp->quit;
Transferring a file from my PC to the website does NOT work using this code:
$ftp = Net::FTP->new("EIS", Debug => 0) or die "Cannot connect to EIS: $@";
$ftp->login("WBSFP",'??????') or die "Cannot login ", $ftp->message;
$ftp->cwd("C:\\") or die "Cannot change working directory ", $ftp->message;
$ftp->put("/home/nevlinkc/abc.txt","abc.txt") or die "Cannot put file ", $ftp->message;
$ftp->quit;
I am trying to FTP a file from a directory on my website to my HDD using Net::FTP in a Perl script. I have a file server running on my PC. I can successfully do a file delete and mkdir using the script, so this proves the integrity of connectivity and drive access. The problem comes in when I try to FTP i.e., put or get an actual file. I believe it has something to do with the path. I have further deduced that it is the file path to the file on the website and that somehow the script is unable to locate the file or something of that nature. I receive an error message "Cannot open data connection". I really thing this means "Cannot find file". I have included a portion of the code below. Please advise. Thx in advance.
Regards,
RPrinceton
use Net::FTP;
Making a new directory works using this code:
$ftp = Net::FTP->new("EIS", Debug => 0) or die "Cannot connect to EIS: $@";
$ftp->login("WBSFP",'??????') or die "Cannot login ", $ftp->message;
$ftp->cwd("C:\\") or die "Cannot change working directory ", $ftp->message;
$ftp->mkdir("newdir") or die "Cannot make new directory ", $ftp->message;
$ftp->quit;
Deleting a file on my C drive works using this code:
$ftp = Net::FTP->new("EIS", Debug => 0) or die "Cannot connect to EIS: $@";
$ftp->login("WBSFP",'??????') or die "Cannot login ", $ftp->message;
$ftp->cwd("C:\\") or die "Cannot change working directory ", $ftp->message;
$ftp->delete("abc.txt") or die "Cannot delete file ", $ftp->message;
$ftp->quit;
Transferring a file from my PC to the website does NOT work using this code:
$ftp = Net::FTP->new("EIS", Debug => 0) or die "Cannot connect to EIS: $@";
$ftp->login("WBSFP",'??????') or die "Cannot login ", $ftp->message;
$ftp->cwd("C:\\") or die "Cannot change working directory ", $ftp->message;
$ftp->put("/home/nevlinkc/abc.txt","abc.txt") or die "Cannot put file ", $ftp->message;
$ftp->quit;