文件是使用js进行上传保存的,现在需要对该对文件继续压缩操作,压缩由java进行。压缩请求来自js。
java部分的代码类似于如下,
zip(HttpServletRequest request){
realPath = request.getSession().getServletContext().getRealPath("/“);
zipUnzip unzip = new zipUnzip();
unzip.importZip(realPath+File.separator+"test.zip", destDir);
}
其中获取真实路径realPath是从session上获取的。