Skip to content

Commit 495b0f0

Browse files
authored
truncate prefixes above the selected level to make the download layout flat (#2987)
1 parent 3275b6a commit 495b0f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

restapi/user_objects.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,10 @@ func getMultipleFilesDownloadResponse(session *models.Principal, params objectAp
722722
continue
723723
}
724724

725-
f, err := addToZip(dObj, objectData.LastModified)
725+
prefixes := strings.Split(dObj, "/")
726+
// truncate upper level prefixes to make the download as flat at the current level.
727+
objectName := prefixes[len(prefixes)-1]
728+
f, err := addToZip(objectName, objectData.LastModified)
726729
if err != nil {
727730
// Ignore errors, move to next
728731
continue

0 commit comments

Comments
 (0)