请教FTP上传问题!文本文件上传到服务器上,丢失内容! 生成文本文件,通过FTP上传到服务器上,但发现上传后,文本丢失内容!请大家帮忙! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String server=Config.getInstance().getConfigItem("UeSoftFtpServer");String user=Config.getInstance().getConfigItem("UeSoftFtpUser");String password=Config.getInstance().getConfigItem("UeSoftFtpPass");String path=Config.getInstance().getConfigItem(model+"_response");String filename=billFiledir + billFileName;System.out.println("filename = "+filename);try { FtpClient ftpClient=new FtpClient(); ftpClient.openServer(server); ftpClient.login(user, password); System.out.println("====="+ftpClient.pwd() + "/" +model + "/response/"); ftpClient.cd(ftpClient.pwd() + "/" +model + "/response/"); ftpClient.binary(); TelnetOutputStream os=ftpClient.put(billFileName); 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) { System.out.println("ex=="+ex);}这是代码 为何这样行,这样却不行? short s1 = 1;s1 = s1+1;是否有错误? short s1 = 1;s1 += 1;是否有错误? oracle ORA-00911: 无效字符 问题 JAVA一个头痛的问题 Java 到底要学什么 关于equals()方法和clone()方法的疑问 两个流的问题 请问如何将从数据库查询到的结果集,中的数据存放到读到GUI中~~ 在JAVA中如何用数组实现把日期转换为星期几 简单问题: 请问:throws 与 try{ }catch() 到底有什么区别?? 求助,问题出在哪里?
String user=Config.getInstance().getConfigItem("UeSoftFtpUser");
String password=Config.getInstance().getConfigItem("UeSoftFtpPass");
String path=Config.getInstance().getConfigItem(model+"_response");
String filename=billFiledir + billFileName;
System.out.println("filename = "+filename);
try {
FtpClient ftpClient=new FtpClient();
ftpClient.openServer(server);
ftpClient.login(user, password);
System.out.println("====="+ftpClient.pwd() + "/" +model + "/response/");
ftpClient.cd(ftpClient.pwd() + "/" +model + "/response/");
ftpClient.binary();
TelnetOutputStream os=ftpClient.put(billFileName);
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) {
System.out.println("ex=="+ex);
}这是代码