diff --git a/lib/services/download_storage_service.dart b/lib/services/download_storage_service.dart index 0c6d84c1..4ca77b81 100644 --- a/lib/services/download_storage_service.dart +++ b/lib/services/download_storage_service.dart @@ -222,7 +222,11 @@ class DownloadStorageService { String _sanitizeFileName(String name) { // Remove invalid filesystem characters: < > : " / \ | ? * // Also remove leading/trailing whitespace and dots - return name.replaceAll(RegExp(r'[<>:"/\\|?*]'), '').replaceAll(RegExp(r'^\.+|\.+$'), '').trim(); + return name + .replaceAll(RegExp(r'[<>:"/\\|?*]'), '') + .replaceAll(RegExp(r'^\.+|\.+$'), '') + .replaceAll('.', '_') + .trim(); } /// Ensure a directory exists, creating it if necessary