看看有没有你要的 :)public void serverFile()
  {String path="路径";
    String filename="文件名";
    String server="你的服务器"
    String user="上传的用户名";
    String password="密码";
    
   try      {
       FtpClient ftpClient=new FtpClient();
       ftpClient.openServer(server);
       ftpClient.login(user, password);
        if (path.length()!=0) ftpClient.cd(path);
       ftpClient.binary();
       TelnetOutputStream os=ftpClient.put(filename);
       File file_in=new File(filename);
        FileInputStream is=new FileInputStream(file_in);
        byte[] bytes=new byte[1024];
       int c;
       while ((c=is.read(bytes))!=-1)          {
           os.write(bytes,0,c);           }
        is.close();
        os.close();
        ftpClient.closeServer();
      } catch (IOException ex) {;}
  }