diff --git a/frontend/appflowy_flutter/lib/plugins/document/document_page.dart b/frontend/appflowy_flutter/lib/plugins/document/document_page.dart index 292b399731..cdfd9f5d9c 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/document_page.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/document_page.dart @@ -195,13 +195,15 @@ class _DocumentPageState extends State final isLocalMode = context.read().isLocalMode; final List imageFiles = []; - final List otherfiles = []; + final List otherFiles = []; + for (final file in details.files) { + final fileName = file.name.toLowerCase(); if (file.mimeType?.startsWith('image/') ?? - false || imgExtensionRegex.hasMatch(file.name)) { + false || imgExtensionRegex.hasMatch(fileName)) { imageFiles.add(file); } else { - otherfiles.add(file); + otherFiles.add(file); } } @@ -213,7 +215,7 @@ class _DocumentPageState extends State ); await editorState!.dropFiles( data.dropTarget!, - otherfiles, + otherFiles, widget.view.id, isLocalMode, ); diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_image.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_image.dart index 989798dcf2..9e48887dbe 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_image.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/paste_from_image.dart @@ -34,7 +34,7 @@ extension PasteFromImage on EditorState { final imageFiles = files.where( (file) => file.mimeType?.startsWith('image/') ?? - false || imgExtensionRegex.hasMatch(file.name), + false || imgExtensionRegex.hasMatch(file.name.toLowerCase()), ); for (final file in imageFiles) {