From 3ef5ca9cc00ee82ef3549396dcbc9da6168731c4 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Tue, 27 Apr 2021 15:14:54 -0500 Subject: [PATCH] Limit file upload sizes to 100MB (#1385) both iOS and Android are having trouble with the current method of loading the entire file to memory, encrypting it, and sending to azure in one go. We will need to come up with a chunking scheme to support larger files in the future --- src/App/Pages/Send/SendAddEditPageViewModel.cs | 2 +- src/App/Pages/Vault/AttachmentsPageViewModel.cs | 2 +- src/App/Resources/AppResources.resx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App/Pages/Send/SendAddEditPageViewModel.cs b/src/App/Pages/Send/SendAddEditPageViewModel.cs index 41f3bb354a..142d461d46 100644 --- a/src/App/Pages/Send/SendAddEditPageViewModel.cs +++ b/src/App/Pages/Send/SendAddEditPageViewModel.cs @@ -356,7 +356,7 @@ namespace Bit.App.Pages AppResources.AnErrorHasOccurred); return false; } - if (FileData.Length > 524288000) // 500 MB + if (FileData.Length > 104857600) // 100 MB { await _platformUtilsService.ShowDialogAsync(AppResources.MaxFileSize, AppResources.AnErrorHasOccurred); diff --git a/src/App/Pages/Vault/AttachmentsPageViewModel.cs b/src/App/Pages/Vault/AttachmentsPageViewModel.cs index 6063d26603..bed4ecf85b 100644 --- a/src/App/Pages/Vault/AttachmentsPageViewModel.cs +++ b/src/App/Pages/Vault/AttachmentsPageViewModel.cs @@ -102,7 +102,7 @@ namespace Bit.App.Pages AppResources.AnErrorHasOccurred); return false; } - if (FileData.Length > 524288000) // 500 MB + if (FileData.Length > 104857600) // 100 MB { await _platformUtilsService.ShowDialogAsync(AppResources.MaxFileSize, AppResources.AnErrorHasOccurred); diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index f6518c92da..419efc43c6 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -926,7 +926,7 @@ Feature Unavailable - Maximum file size is 500 MB. + Maximum file size is 100 MB. You cannot use this feature until you update your encryption key.