mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
feat(server): specify names for thumbnail files (#14425)
This commit is contained in:
parent
56d2309122
commit
4eb7758f56
3 changed files with 12 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ export class ImmichFileResponse {
|
|||
public readonly path!: string;
|
||||
public readonly contentType!: string;
|
||||
public readonly cacheControl!: CacheControl;
|
||||
public readonly fileName?: string;
|
||||
|
||||
constructor(response: ImmichFileResponse) {
|
||||
Object.assign(this, response);
|
||||
|
|
@ -56,6 +57,9 @@ export const sendFile = async (
|
|||
}
|
||||
|
||||
res.header('Content-Type', file.contentType);
|
||||
if (file.fileName) {
|
||||
res.header('Content-Disposition', `inline; filename="${file.fileName}"`);
|
||||
}
|
||||
|
||||
const options: SendFileOptions = { dotfiles: 'allow' };
|
||||
if (!isAbsolute(file.path)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue