mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Fix: download archived file anonymously
This commit is contained in:
@@ -38,13 +38,16 @@ func (fs *FileSystem) Compress(ctx context.Context, folderIDs, fileIDs []uint) (
|
||||
}
|
||||
|
||||
// 创建临时压缩文件
|
||||
zipFilePath := filepath.Join(model.GetSettingByName("temp_path"), fmt.Sprintf("archive_%d.zip", time.Now().UnixNano()))
|
||||
zipFilePath := filepath.Join(
|
||||
model.GetSettingByName("temp_path"),
|
||||
fmt.Sprintf("archive_%d.zip", time.Now().UnixNano()),
|
||||
)
|
||||
zipFile, err := util.CreatNestedFile(zipFilePath)
|
||||
defer zipFile.Close()
|
||||
if err != nil {
|
||||
util.Log().Warning("%s", err)
|
||||
return "", err
|
||||
}
|
||||
defer zipFile.Close()
|
||||
|
||||
// 创建压缩文件Writer
|
||||
zipWriter := zip.NewWriter(zipFile)
|
||||
|
||||
Reference in New Issue
Block a user