fix: store content type at upload time instead of guessing from extension

Previously FileService fell back to extension-based MIME detection, causing
TIFF, HEIC, DOCX and other unlisted types to be served as octet-stream
(forced download instead of inline display).

- Add content_type column to documents (V3 migration)
- Store file.getContentType() in DocumentService on upload and file replace
- MassImportService uses Files.probeContentType() for local files
- DocumentController prefers doc.getContentType() over S3-reported type
- FileService: remove extension-based fallback (no longer needed)
- DocumentService: replace leftover ResponseStatusException with DomainException

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-03-15 14:42:19 +01:00
parent 1819829d6e
commit 79eccd5598
6 changed files with 30 additions and 18 deletions

View File

@@ -0,0 +1 @@
ALTER TABLE documents ADD COLUMN content_type character varying(255);