之前转载过一个大佬的java批量下载工具类,在这里再次感谢那位大哥文章的帮助,附上大佬的博客https://blog.csdn.net/weixin_44204751/article/details/104265517
今天记录一下我控制器的代码,防止以后忘记
/**
* 批量下载文件
* @param request
* @param response
* @throws Exception
*/
@RequestMapping(value="batchDownloadFile",method = RequestMethod.GET)
public void batchDownloadFile(HttpServletRequest request,HttpServletResponse response) throws Exception{
String code=this.getPara("code");
String nameList=this.getPara("nameList");
String ctxPath="";
List<File> fileList = new ArrayList<File>(); //文件的集合
ctxPath=request<