mirror of
https://github.com/immich-app/immich.git
synced 2025-12-18 01:11:07 +03:00
feat(server): specify names for thumbnail files (#14425)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user