帮助类: using QSProjectBase; using Reform.CommonLib; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; namespace Reform.CommonLib { /// <summary> /// ftp操作 /// </summary> publ
利用struts2框架上传文件时,如果想要获取上传文件的大小可以利用下面的方式进行: FileInputStream ins = new FileInputStream(file); if (ins.available() > 1024 * 1024 * 3) { System.out.println("上传的文件不能超过3M,请重新上传"); } 或者下面的方式: File file = new File(uploadObjectPath); if (file.length()