diff --git a/modules/storage/obs.go b/modules/storage/obs.go index eea716725..c98e570c5 100755 --- a/modules/storage/obs.go +++ b/modules/storage/obs.go @@ -341,6 +341,7 @@ func GetAllObjectByBucketAndPrefix(bucket string, prefix string) ([]FileInfo, er index++ for _, val := range output.Contents { var isDir bool + log.Info("val.key=" + val.Key) if val.Key == prefix { continue } diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 807fa192c..1a267ddd1 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -192,13 +192,11 @@ func DownloadMultiModelFile(ctx *context.Context) { ctx.Resp.Header().Set("Content-Type", "application/octet-stream") allFile, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, path) if err != nil { - w := zip.NewWriter(ctx.Resp) defer w.Close() - for _, oneFile := range allFile { if !oneFile.IsDir { - log.Info("zip file name:" + oneFile.FileName) + log.Info("zip file name:" + oneFile.FileName) fDest, err := w.Create(oneFile.FileName) if err != nil { log.Info("create zip entry error, download file failed: %s\n", err.Error())