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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user