diff --git a/b0esche_cloud/lib/services/file_service.dart b/b0esche_cloud/lib/services/file_service.dart index 606b3b4..ee5f88e 100644 --- a/b0esche_cloud/lib/services/file_service.dart +++ b/b0esche_cloud/lib/services/file_service.dart @@ -119,9 +119,18 @@ class FileService { String parentPath, String folderName, ) async { - // Normalize parent path and construct new folder path - final normalizedParent = parentPath == '/' ? '' : parentPath; - final path = '$normalizedParent/$folderName'; + // Construct proper path: /parent/folder or /folder for root + String path; + if (parentPath == '/') { + path = '/$folderName'; + } else { + // Ensure parentPath doesn't end with / before appending + final cleanParent = parentPath.endsWith('/') + ? parentPath.substring(0, parentPath.length - 1) + : parentPath; + path = '$cleanParent/$folderName'; + } + final data = { 'name': folderName, 'path': path,