Hi Guys,
I am trying to transfer file via. ftp using command line in my Perl script. However, for some reason after sending first file successfully, the connection gets lost. The log file (ftplog) shows the error as 'Not Connected'.
$command=("ftp -n -i -s:to_ftp.ftp > $ftplog");
system($command);
my ftp script file (to_ftp.ftp) looks like this:
open ftp.to_ftp.com
user
abc
password
ascii
lcd d:\main\jobs\abc\data
cd IN
mput *.txt
dir *.txt
quit
The above only transfers one file and then shows 'Not Connected' as shown in the log file below:
ftp> Connected to ftp.to_ftp.com.
open ftp.to_ftp.com
220 ProFTPD 1.2.10 Server ready.
ftp> Username
password
331 Password required for abc
230 User abc logged in.
ftp> ascii
200 Type set to A
ftp> Local directory now d:\main\jobs\abc\data.
ftp> lcd d:\main\jobs\abc\data
cd IN
250 CWD command successful
ftp> mput *.txt
200 PORT command successful
150 Opening ASCII mode data connection for abc_20090612-1145.txt
226 Transfer complete.
ftp: 6350474 bytes sent in 78.50Seconds 80.90Kbytes/sec.
200 PORT command successful
ftp> Not connected.
ftp> dir *.txt
quit
Please help.
I am trying to transfer file via. ftp using command line in my Perl script. However, for some reason after sending first file successfully, the connection gets lost. The log file (ftplog) shows the error as 'Not Connected'.
$command=("ftp -n -i -s:to_ftp.ftp > $ftplog");
system($command);
my ftp script file (to_ftp.ftp) looks like this:
open ftp.to_ftp.com
user
abc
password
ascii
lcd d:\main\jobs\abc\data
cd IN
mput *.txt
dir *.txt
quit
The above only transfers one file and then shows 'Not Connected' as shown in the log file below:
ftp> Connected to ftp.to_ftp.com.
open ftp.to_ftp.com
220 ProFTPD 1.2.10 Server ready.
ftp> Username
password
331 Password required for abc
230 User abc logged in.
ftp> ascii
200 Type set to A
ftp> Local directory now d:\main\jobs\abc\data.
ftp> lcd d:\main\jobs\abc\data
cd IN
250 CWD command successful
ftp> mput *.txt
200 PORT command successful
150 Opening ASCII mode data connection for abc_20090612-1145.txt
226 Transfer complete.
ftp: 6350474 bytes sent in 78.50Seconds 80.90Kbytes/sec.
200 PORT command successful
ftp> Not connected.
ftp> dir *.txt
quit
Please help.