整了一个工具类,简化文件上传的一些基本操作。(基于common-fileupload)
一般常用的有三种上传组件是用的比较多的有三种。
参考:http://www.oschina.net/question/1_4442 三种文件的比较
自己整了个文件上传的工具类。整合文件类型检查,缓冲相关的设置,文件保存策略,和普通表单域封装。
贴下代码,有好意见和改进的欢迎评论。
用的是最常用的common-uploadfile
接口:
public String getFileExt(File file) { return file.getName().substring(file.getName().?lastIndexOf?(".") + 1); } 4 楼 234369425 2012-07-23 Apache的smartupload 5 楼 lohasle 2012-07-24 234369425 写道Apache的smartuploadsmartupload 性能不高