如何用JAVA上传所有类型的文件且满足文件名为中文的情况 FileInputStream(file) 类只能上传文本和图象之类的文件,如execl等文件上传后文件被损坏,有没有能够上传所有类型文件的java类啊,另外能否解决文件中带中文上传不了的问题,神仙们帮帮忙啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 能传图像,为什么不能传EXCEL?肯定是你的文件上传类写的不正确 传是能传上去, 但上传后的execl文件或者word文件打开失败 或提示Word无法读取此文档,文档可能已损坏... org.apache.commons.net.ftp.ftpclient.storeFile(remoteFile,FileInputStream) 上传文本文件可以,上传execl或word文件后在上传的位置打不开 用Commons-fileuploads包,代码如下public static boolean upload(String uploadedFile,String targetFile){ boolean tag = false; File upload = null; File target = null; try{ upload = new File(uploadedFile); target = new File(targetFile); FileUtils.copyFile(upload, target); tag = true; }catch (Exception e) { if(Constant.DEBUG){ e.printStackTrace(); } throw new UploadException("上传失败!"); } return tag; } 我是新手,请大家看看 求JSWDK1.0.1 急问!我定义了一个类,里面有static成员变量,这些成员变量什么时候会被释放? 为什么超过255个字符就不能取出来? 想利用java开发一个邮件程序! 排序 关于继承和构造方法 请教一个Java的“Swing小错误出现的原因”. 《最新java2核心技术卷Ⅰ原理》书中源代码哪有下载? 100分 JDBC连接工具类并发 Java Io的一个问题 java内存溢出 改怎么改
boolean tag = false;
File upload = null;
File target = null;
try{
upload = new File(uploadedFile);
target = new File(targetFile);
FileUtils.copyFile(upload, target);
tag = true;
}catch (Exception e) {
if(Constant.DEBUG){
e.printStackTrace();
}
throw new UploadException("上传失败!");
}
return tag;
}