2020
11-06
11-06
springboot单文件下载和多文件压缩zip下载的实现
单文件下载//下载单个文件publicvoiddownloadFile(HttpServletResponseresponse){Stringpath="D:\test\ce\1.txt"Filefile=newFile(path);if(file.exists()){StringfileName=file.getName();response.setHeader("Content-Disposition","attachment;fileName="+fileName);download(response,file);}}publicvoiddownload(HttpServletResponseresponse,Filefile){FileInp...
继续阅读 >