Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add application/octect-stream as general filetype to support import custom extensions in mobile (#1923)

Leendert de Borst172613fab308
diff --git a/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/Components/ImportServiceCard.razor b/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/Components/ImportServiceCard.razor
index aa9fab915..da8bc6b46 100644
--- a/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/Components/ImportServiceCard.razor
+++ b/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/Components/ImportServiceCard.razor
@@ -77,7 +77,7 @@
@ChildContent
<div class="mb-4 bg-amber-50 border border-amber-400 dark:bg-amber-800/30 dark:border-amber-500/50 rounded-lg p-4">
<p class="mb-4 text-gray-700 dark:text-gray-200">@string.Format(Localizer["UploadExportFileText"], ServiceName)</p>
- <InputFile OnChange="HandleFileUpload" accept="@AcceptedFileTypes" class="text-gray-700 dark:text-gray-200 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-semibold file:bg-primary-50 file:text-primary-700 hover:file:bg-primary-100 dark:file:bg-primary-900/40 dark:file:text-primary-300 dark:hover:file:bg-primary-800/60" />
+ <InputFile OnChange="HandleFileUpload" accept="@FileAcceptTypes" class="text-gray-700 dark:text-gray-200 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-semibold file:bg-primary-50 file:text-primary-700 hover:file:bg-primary-100 dark:file:bg-primary-900/40 dark:file:text-primary-300 dark:hover:file:bg-primary-800/60" />
</div>
<div class="flex justify-end mt-6 space-x-2">
<Button OnClick="@CloseModal" Color="secondary">@Localizer["CancelButton"]</Button>
@@ -306,6 +306,13 @@
[Parameter]
public string AcceptedFileTypes { get; set; } = string.Empty;
+ /// <summary>
+ /// The effective accept attribute for the file input. Includes application/octet-stream as a fallback
+ /// so that iOS and other mobile platforms allow selecting files with custom extensions (e.g. .avex, .avux, .1pux)
+ /// that don't have a registered MIME type.
+ /// </summary>
+ private string FileAcceptTypes => AcceptedFileTypes + ",application/octet-stream";
+
private bool IsModalOpen { get; set; } = false;
private bool IsImporting { get; set; } = false;
private string? ImportError { get; set; }