Admin setting for the maximum upload size

- Admin -> Settings: maximum upload size per file (1-1024 MB, default 50),
  stored in a new settings table and read on each use, so a change applies
  to every process at once
- Enforced by attachment validation and the direct-upload endpoint; upload
  forms, bulk upload and Admin -> About show the current limit
- .sam.zip import accepts files up to 1 GB to match

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-07 09:45:12 -05:00
1 parent 4f548f3874
commit ef7cd2efba
16 files changed
+186 -13

No files matched your search

+2 -2
View File
@@ -3,7 +3,7 @@
<% file_classes = "block w-full text-sm text-slate-600 file:mr-3 file:rounded-md file:border-0 file:bg-slate-100 file:px-3 file:py-1.5 file:text-sm file:font-medium hover:file:bg-slate-200" %>
<%= form_with url: bulk_aircraft_documents_path(@aircraft), multipart: true, class: "card card-body max-w-3xl space-y-4",
data: { controller: "bulk-upload", bulk_upload_url_value: rails_direct_uploads_path,
bulk_upload_max_bytes_value: UploadValidation::MAX_SIZE, action: "submit->bulk-upload#submit" } do %>
bulk_upload_max_bytes_value: UploadValidation.max_size, action: "submit->bulk-upload#submit" } do %>
<div>
<h2 class="card-title">Bulk upload</h2>
<p class="text-sm text-slate-500">Each file becomes its own document, named after the file. Give files the same name to combine them, in order, as the pages of one document.</p>
@@ -44,7 +44,7 @@
data-bulk-upload-target="folder" data-action="change->bulk-upload#add">
</div>
</div>
<p class="hint !mt-1">Images, PDFs or text, up to <%= UploadValidation::MAX_SIZE / 1.megabyte %> MB each and <%= DocumentsController::MAX_BULK_FILES %> at a time.</p>
<p class="hint !mt-1">Images, PDFs or text, up to <%= Setting.max_upload_mb %> MB each and <%= DocumentsController::MAX_BULK_FILES %> at a time.</p>
<div data-bulk-upload-target="panel" hidden class="space-y-2">
<div class="flex flex-wrap items-center justify-between gap-2">