|
@@ -115,6 +115,8 @@ public class FileController {
|
|
|
private void download(FileInfo info, HttpServletResponse response) throws Exception{
|
|
private void download(FileInfo info, HttpServletResponse response) throws Exception{
|
|
|
response.setContentType("application/force-download");
|
|
response.setContentType("application/force-download");
|
|
|
if (info.isFolder()) {
|
|
if (info.isFolder()) {
|
|
|
|
|
+ response.setHeader("Content-disposition",
|
|
|
|
|
+ "attachment; filename=" + URLEncoder.encode(info.getName() + ".zip", "UTF-8"));
|
|
|
// 压缩后下载
|
|
// 压缩后下载
|
|
|
try (ArchiveOutputStream out = new ZipArchiveOutputStream(response.getOutputStream());) {
|
|
try (ArchiveOutputStream out = new ZipArchiveOutputStream(response.getOutputStream());) {
|
|
|
cascadeOutput(info, null, out);
|
|
cascadeOutput(info, null, out);
|