|
|
|
@ -127,15 +127,17 @@ func (this *MatterService) DownloadZip( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
destZipName := matters[0].Name |
|
|
|
if len(matters) == 1 && !matters[0].Dir { |
|
|
|
download.DownloadFile(writer, request, matters[0].AbsolutePath(), destZipName, true) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//prepare the temp zip dir
|
|
|
|
destZipDirPath := fmt.Sprintf("%s/%d", GetUserZipRootDir(matters[0].Username), time.Now().UnixNano()/1e6) |
|
|
|
util.MakeDirAll(destZipDirPath) |
|
|
|
|
|
|
|
destZipName := fmt.Sprintf("%s.zip", matters[0].Name) |
|
|
|
if len(matters) > 1 || !matters[0].Dir { |
|
|
|
destZipName = "archive.zip" |
|
|
|
} |
|
|
|
|
|
|
|
destZipName = "archive.zip" |
|
|
|
destZipPath := fmt.Sprintf("%s/%s", destZipDirPath, destZipName) |
|
|
|
|
|
|
|
this.zipMatters(request, matters, destZipPath) |
|
|
|
|