🐛 Fix issues when saving image to gallery without ext name

This commit is contained in:
2025-08-21 02:22:21 +08:00
parent 923d5d7514
commit 81cd9b2082

View File

@@ -326,7 +326,11 @@ class CloudFileZoomIn extends HookConsumerWidget {
// Create a temporary file to save the image
final tempDir = await getTemporaryDirectory();
final filePath = '${tempDir.path}/${item.id}.${extension(item.name)}';
var extName = extension(item.name).trim();
if (extName.isEmpty) {
extName = item.mimeType?.split('/').lastOrNull ?? 'jpeg';
}
final filePath = '${tempDir.path}/${item.id}.$extName';
await client.download(
'/drive/files/${item.id}',