继前面的甘特图之后,这次来说说wex5中如何实现简单的文件上传和删除,直接上代码
文件上传
public static JSONObject FileUpload(JSONObject params, ActionContext context) { JSONObject ret = new JSONObject(); HttpServletRequest request = (HttpServletRequest) context.get(ActionContext.REQUEST); if (!request.getMethod().equals("POST")) { // 非POST直接空内容响应 return null; } if (isfirst) { String baasPath = request.getSession().getServletContext().getRealPath("/") + ".." + File.separator + ".."; docStorePath = baasPath + File.separator + "data" + File.separator + "Files"; System.out.println(docStorePath); File file = new File(docStorePath); if (!(file.exists() && file.isDirectory())) { file.mkdirs(); } try { docStorePath = file.getCanonicalPath(); } catch (IOException e) { e.printStackTrace
关于wex5中如何实现文件上传
最新推荐文章于 2024-06-11 09:42:45 发布