Update AliasVault.Client client-side local import filesize limit for 50MB to 1GB (#1786)

This commit is contained in:
Leendert de Borst
2026-04-24 15:03:59 +02:00
committed by Leendert de Borst
parent 3577b00280
commit c8e1626967
2 changed files with 9 additions and 5 deletions

View File

@@ -1044,11 +1044,15 @@
IsImporting = true;
StateHasChanged();
// Limit file size to 50MB (increased for binary files with attachments)
var maxFileSize = 50 * 1024 * 1024;
// Limit file size fixed in code to 1024MB.
// This is a browser-memory safety ceiling, not a server/infra limit. The file
// is parsed entirely client-side and never uploaded. Server upload limits for the
// resulting vault sync are controlled separately via the MAX_UPLOAD_SIZE_MB env var.
const int maxFileSizeMb = 1024;
var maxFileSize = maxFileSizeMb * 1024 * 1024;
if (e.File.Size > maxFileSize)
{
ImportError = Localizer["ImportErrorFileTooLarge"];
ImportError = Localizer["ImportErrorFileTooLarge", maxFileSizeMb];
return;
}

View File

@@ -167,8 +167,8 @@
<comment>Error message when user selects an unsupported file format. {0} is the list of supported extensions</comment>
</data>
<data name="ImportErrorFileTooLarge" xml:space="preserve">
<value>File size exceeds 10MB limit.</value>
<comment>Error message when file is too large</comment>
<value>File size exceeds {0}MB limit.</value>
<comment>Error message when file is too large. {0} is the maximum allowed size in megabytes</comment>
</data>
<data name="EncryptedFilePasswordPrompt" xml:space="preserve">
<value>This file is encrypted. Please enter the password you used when creating the export.</value>