need_help21 has asked for the wisdom of the Perl Monks concerning the following question:
Please someone help me!! Thanks !!sub fnSaveFile { my $sDriver = $vars{'driverfname'}; my $sXML = $vars{'xmlfname'}; #print $sDriver; if ($sDriver eq '' || $sXML eq '') { fnShowForm(); print "please provide information for the empty fie +lds to execute"; exit(); } my $sFile = "C:/MyCreationInPerl/$sDriver"; open(FILE,">$sFile") or die "Can not open file $sDriver"; $sReport1 = 'temp'; print FILE "some information"; close FILE; my $sFile = "C:/MyCreationInPerl/$sXML"; open(FILE,">$sFile") or die "cannot open file"; print FILE "some information"; close FILE; my $host = 'xx.xx.xx.xx'; my $ftp = Net::FTP->new($host, Timeout => 300, Debug=>1) or die "Cannot contact $host: $!"; my $output2 = $ftp->login('xxxx','xxxxxx') or die "Can't login ($host):" . $ftp->message; $ftp->pasv(); my $path1 = '/testdata/BatchValidation/driver/'; my $output = $ftp->cwd($path1) or die "cannot change dir +ectory $path1"; $ftp->ascii(); my $filenameDriver = "C:\\MyCreationInPerl\\$sDriver"; my $output1 = $ftp->put($filenameDriver) or die $ftp->message; print $output1; #my $path2 = '/testdata/BatchValidation/xml'; #my $output = $ftp->cwd($path2) or die "cannot change director +y $path2"; #$ftp->ascii(); #my $filenameXML = "C:\\MyCreationInPerl\\$sXML"; #my $output3 = $ftp->put($filenameXML) or die "cannot put $fil +enameXML to the destination"; ##print $output1; #Win32::MsgBox ("Files have been transfered"); $ftp->quit; fnShowFormForExecution(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl: FTP using cgi not working but FTP s/w works well
by tuxz0r (Pilgrim) on Nov 20, 2007 at 17:08 UTC | |
by need_help21 (Novice) on Nov 21, 2007 at 03:13 UTC | |
by erroneousBollock (Curate) on Nov 21, 2007 at 03:36 UTC | |
by tuxz0r (Pilgrim) on Nov 21, 2007 at 03:44 UTC |