|
|
|
@@ -187,11 +187,12 @@ func DownloadMultiModelFile(ctx *context.Context) { |
|
|
|
return |
|
|
|
} |
|
|
|
path := Model_prefix + models.AttachmentRelativePath(id) + "/" |
|
|
|
returnFileName := task.Name + "_" + task.Version + ".zip" |
|
|
|
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+returnFileName) |
|
|
|
ctx.Resp.Header().Set("Content-Type", "application/octet-stream") |
|
|
|
|
|
|
|
allFile, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, path) |
|
|
|
if err != nil { |
|
|
|
if err == nil { |
|
|
|
returnFileName := task.Name + "_" + task.Version + ".zip" |
|
|
|
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+returnFileName) |
|
|
|
ctx.Resp.Header().Set("Content-Type", "application/octet-stream") |
|
|
|
w := zip.NewWriter(ctx.Resp) |
|
|
|
defer w.Close() |
|
|
|
for _, oneFile := range allFile { |
|
|
|
@@ -228,6 +229,9 @@ func DownloadMultiModelFile(ctx *context.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
log.Info("error,msg=" + err.Error()) |
|
|
|
ctx.ServerError("no file to download.", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|