truncate prefixes above the selected level to make the download layout flat (#2987)

This commit is contained in:
Prakash Senthil Vel
2023-08-09 22:59:41 +05:30
committed by GitHub
parent 3275b6a6d8
commit 495b0f0068

View File

@@ -722,7 +722,10 @@ func getMultipleFilesDownloadResponse(session *models.Principal, params objectAp
continue
}
f, err := addToZip(dObj, objectData.LastModified)
prefixes := strings.Split(dObj, "/")
// truncate upper level prefixes to make the download as flat at the current level.
objectName := prefixes[len(prefixes)-1]
f, err := addToZip(objectName, objectData.LastModified)
if err != nil {
// Ignore errors, move to next
continue