public String LoadImageToServer(String filePath,String serverPath) throws Exception {
String resultPath = ""; //上传后图片所在的路径
FileOutputStream out = null; //文件输出流
try { //验证图片上传的格式是否正确
File f = new File(filePath);
if (!f.isFile()) {
throw new Exception(f " 不是图片文件!");
}
if (f != null && f.exists()) { //这里的ImageIO属于java工厂类,在工厂类class里面,调用的System.gc(),频繁调用会造成dump,需要考虑优化
String resultPath = ""; //上传后图片所在的路径
FileOutputStream out = null; //文件输出流
try { //验证图片上传的格式是否正确
File f = new File(filePath);
if (!f.isFile()) {
throw new Exception(f " 不是图片文件!");
}
if (f != null && f.exists()) { //这里的ImageIO属于java工厂类,在工厂类class里面,调用的System.gc(),频繁调用会造成dump,需要考虑优化