使用use Net::FTP;
Demo:
    my $Server = '192.168.1.1';
    my $User = 'admin';
    my $Password = 'admin';
   
    my $ftp = Net::FTP->new($Server,Passive => 0, Debug => 1,Timeout => 10) or die "Could not connect.\n";
    if (defined $ftp)
    {
        if ($ftp->login($User, $Password) or die "Could not login. \n")
        {  
            $ftp->cwd("config");                   #切换目录   
  
            $ftp->put($g_file);                     #上传文件
        }
    }
    $ftp->quit();                                      #退出ftp

相关文章:

  • 2021-11-26
  • 2021-12-09
  • 2021-06-13
  • 2022-01-25
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
相关资源
相似解决方案