"/" + Constants.YEAR + "/" + Constants.MONTH + "/" + imgName;
System.out.println(imgUrl);
// 替换到原文章内容
body = StringUtil.replaceAll(body, img, imgUrl);
}
System.out.println(body);
out.println(body);
}
out.flush();
out.close();
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("123");
out.flush();
out.close();
}
}
呵呵,整个类都考下来啦。备用吧。
作用:在编辑器里把文章图片拷贝过来的时候,调用此类可以把图片上传到本地指定的文件夹内。
注意:图片是加密过的名字会报错的,原因:未研究。