I'm trying to do 2 things.
1. FTP files with PERL
2. Display the file upload progress
Here is some code I have tried and I get the message "system can't find the file path". I'm not sure how the $tmp and $afile variables should be used. $FORM{'fileUploadObj'} is the file to be uploaded.
my $ftp="/usr/local/bin/ftp";
#my $tmp='filename.txt';
my $tmp=$FORM{'fileUploadObj'};
#my $afile="somefile.pl";
my $afile=$FORM{'fileUploadObj'};
my $host = "192.168.1.101";
my $dir = "C:\InetPub\Ftproot";
open(FTP, "| $ftp -n $host >$tmp");
print FTP "user username\n";
print FTP "-password\n";
print FTP "ls\n";
print FTP "cd $dir\n";
print FTP "get $afile\n";
print FTP "binary\n";
print FTP "quit\n";
close(FTP);
OK I tried out the sample script below and I can't change directories (cwd) and can't upload files. I don't get any errors on login. Any suggestion? Anybody...
Bookmarks