diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/file/file_util.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/file/file_util.dart index cedeaec2ee..f4066a94f2 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/file/file_util.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/file/file_util.dart @@ -3,7 +3,6 @@ import 'dart:io'; import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/plugins/document/application/document_service.dart'; import 'package:appflowy/startup/startup.dart'; -import 'package:appflowy/util/file_extension.dart'; import 'package:appflowy/workspace/application/settings/application_data_storage.dart'; import 'package:appflowy_backend/dispatch/error.dart'; import 'package:appflowy_backend/log.dart'; @@ -39,14 +38,6 @@ Future<(String? path, String? errorMessage)> saveFileToCloudStorage( String localFilePath, String documentId, ) async { - final size = localFilePath.fileSize; - if (size == null || size > 10 * 1024 * 1024) { - // 10MB - return ( - null, - LocaleKeys.document_plugins_file_fileTooBigError.tr(), - ); - } final documentService = DocumentService(); Log.debug("Uploading file from local path: $localFilePath"); final result = await documentService.uploadFile( diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/image/image_util.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/image/image_util.dart index 6e650f1bf8..e7b818ead7 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/image/image_util.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/image/image_util.dart @@ -7,7 +7,6 @@ import 'package:appflowy/plugins/document/application/prelude.dart'; import 'package:appflowy/plugins/document/presentation/editor_plugins/image/common.dart'; import 'package:appflowy/shared/custom_image_cache_manager.dart'; import 'package:appflowy/startup/startup.dart'; -import 'package:appflowy/util/file_extension.dart'; import 'package:appflowy/workspace/application/settings/application_data_storage.dart'; import 'package:appflowy/workspace/presentation/home/toast.dart'; import 'package:appflowy_backend/dispatch/error.dart'; @@ -47,14 +46,6 @@ Future<(String? path, String? errorMessage)> saveImageToCloudStorage( String localImagePath, String documentId, ) async { - final size = localImagePath.fileSize; - if (size == null || size > 10 * 1024 * 1024) { - // 10MB - return ( - null, - LocaleKeys.document_imageBlock_uploadImageErrorImageSizeTooBig.tr(), - ); - } final documentService = DocumentService(); Log.debug("Uploading image local path: $localImagePath"); final result = await documentService.uploadFile( diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/UploadImage.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/UploadImage.tsx index a6b66a4c1f..d39da68caf 100644 --- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/UploadImage.tsx +++ b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/UploadImage.tsx @@ -11,15 +11,13 @@ export function UploadImage({ onDone }: { onDone?: (url: string) => void }) { const checkTauriFile = useCallback( async (url: string) => { - const { readBinaryFile } = await import('@tauri-apps/api/fs'); - - const buffer = await readBinaryFile(url); - const blob = new Blob([buffer]); - - if (blob.size > MAX_IMAGE_SIZE) { - notify.error(t('document.imageBlock.error.invalidImageSize')); - return false; - } + // const { readBinaryFile } = await import('@tauri-apps/api/fs'); + // const buffer = await readBinaryFile(url); + // const blob = new Blob([buffer]); + // if (blob.size > MAX_IMAGE_SIZE) { + // notify.error(t('document.imageBlock.error.invalidImageSize')); + // return false; + // } return true; },