I have a simple scenario. I upload a zip file on a disk to some server.
use Net::FTP; my $ftp = Net::FTP->new($server, Timeout=>1800, Passive=>1, Debug=>3); $ftp->login($user, $pswd); $ftp->cwd("files"); $ftp->binary(); $ftp->put("build.zip");
The put() succeeds 9 out of 10 times, but for the 10th time (and this is very random), it throws up.
This, I know is because of: 1. Server closing connection, or 2. Internet link break 3. Unknown
My question is what *really* tells me that put() has failed?
a. I have tried $ftp->message but this is empty.
b. $! as I know is not exactly the way, it tells me 'bad file descriptor'
c. I also used eval() with $ftp->message, but is empty as well
So what gives?
By the way, when I try this on a DOS prompt and stop the ftp server, this is what I get.
ftp bin
200 Type set to I
ftp mput build.zip
mput build.zip? y
200 Port command successful
150 Opening data channel for file transfer.
Netout :Software caused connection abort
421 Server is going offline
Connection closed by remote host.
Notice the last 3 lines, I know exactly what went wrong.
Your help is appreciated.
In reply to Perl Net::FTP put() gives little help on errors by amitsk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |