fix: PDFs im Preview-iframe statt neuem Tab

Download-Endpoint unterstuetzt jetzt ?inline=1, wodurch
Content-Disposition auf inline statt attachment gesetzt wird.
PDF- und Bild-Preview nutzen diesen Parameter, damit der
Browser das PDF im Preview-Iframe rendert statt einen Download
auszuloesen. Normale Download-Buttons bleiben unveraendert.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stefan Hacker
2026-04-12 09:55:40 +02:00
parent 50385faa02
commit 6aad986d78
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -157,7 +157,7 @@ async function loadPreview() {
previewType.value = data.type
if (data.type === 'pdf' || data.type === 'image') {
previewUrl.value = getTokenUrl(`/api/files/${fileId}/download`)
previewUrl.value = getTokenUrl(`/api/files/${fileId}/download?inline=1`)
canEdit.value = false
} else if (data.type === 'html') {
htmlContent.value = data.content