Android 使用FTP上传文件
16lz
2021-01-23
Try using apache commons ftp
ftpClient.connect(InetAddress.getByName(server)); ftpClient.login(user, password); ftpClient.changeWorkingDirectory(serverRoad); ftpClient.setFileType(FTP.BINARY_FILE_TYPE); BufferedInputStream buffIn=null; buffIn=new BufferedInputStream(new FileInputStream(file)); ftpClient.enterLocalPassiveMode(); ftpClient.storeFile("test.txt", buffIn); buffIn.close(); ftpClient.logout(); ftpClient.disconnect();
必须使用被动模式
更多相关文章
- android 飞行模式 注册广播后 三种状态监听
- android 的单例模式
- 【Android】Vibrator(震动模式)设置长短震动
- Android 情景模式提示音默认修改
- Android是否可以实现静默安装模式
- Android和设计模式:代理模式
- Android 深色模式适配
- 探索新的Android权限模式
- android静音模式下仍可以播放媒体声音以及调节其大小。。。。