#281 refinements: transcoded filename extensions, allowDownload:2 caveats in docs

This commit is contained in:
Alan Grainger
2026-08-20 07:35:49 +12:00
parent a2776f9933
commit 2a5580e5a2
5 changed files with 81 additions and 7 deletions
+6 -1
View File
@@ -79,7 +79,12 @@ export async function assetBuffer (req: IncomingShareRequest, res: Response, ass
}
if (attachment && asset.originalFileName) {
const filename = encodeURI(getFilename(asset, servedSize))
// Playback downloads serve Immich's transcode, so the filename extension
// must follow the response's content-type, not the original file's.
const playbackMime = useVideoPlayback
? (data.headers.get('content-type') || '').split(';')[0].trim() || undefined
: undefined
const filename = encodeURI(getFilename(asset, servedSize, playbackMime))
res.setHeader('Content-Disposition', `attachment; filename*=UTF-8''${filename}`)
}
headerList.forEach(header => {