diff --git a/go_cloud/api b/go_cloud/api index 79f6ad8..d5ee341 100755 Binary files a/go_cloud/api and b/go_cloud/api differ diff --git a/go_cloud/internal/http/routes.go b/go_cloud/internal/http/routes.go index a564361..7606ddb 100644 --- a/go_cloud/internal/http/routes.go +++ b/go_cloud/internal/http/routes.go @@ -1881,13 +1881,15 @@ func downloadOrgFolderAsZip(w http.ResponseWriter, r *http.Request, db *database zipWriter := zip.NewWriter(w) defer zipWriter.Close() + // Ensure folderPath ends with / for proper relative path calculation + if !strings.HasSuffix(folderPath, "/") { + folderPath += "/" + } + // Add each file to ZIP for _, file := range fileList { // Calculate relative path in ZIP relPath := strings.TrimPrefix(file.Path, folderPath) - if relPath[0] == '/' { - relPath = relPath[1:] - } // Download file from WebDAV remoteRel := strings.TrimPrefix(file.Path, "/") @@ -2035,13 +2037,15 @@ func downloadUserFolderAsZip(w http.ResponseWriter, r *http.Request, db *databas zipWriter := zip.NewWriter(w) defer zipWriter.Close() + // Ensure folderPath ends with / for proper relative path calculation + if !strings.HasSuffix(folderPath, "/") { + folderPath += "/" + } + // Add each file to ZIP for _, file := range fileList { // Calculate relative path in ZIP relPath := strings.TrimPrefix(file.Path, folderPath) - if relPath[0] == '/' { - relPath = relPath[1:] - } // Download file from WebDAV remotePath := strings.TrimPrefix(file.Path, "/")