diff --git a/server/src/controller/both/EntityController.ts b/server/src/controller/both/EntityController.ts index 05e23d6..5696221 100644 --- a/server/src/controller/both/EntityController.ts +++ b/server/src/controller/both/EntityController.ts @@ -39,19 +39,19 @@ export default class EntityController { let ext; switch(entity.mimeType) { case 'image/jpeg': - ext = 'jpeg'; + ext = '.jpeg'; break; case 'image/png': - ext = 'png'; + ext = '.png'; break; case 'image/gif': - ext = 'gif'; + ext = '.gif'; break; case 'video/mp4': - ext = 'mp4'; + ext = '.mp4'; break; case 'audio/x-flac': - ext = 'flac'; + ext = '.flac'; default: return reply .code(500) @@ -64,7 +64,7 @@ export default class EntityController { return reply .code(200) .type(entity.mimeType) - .header("content-disposition", `attachment; filename=\"${id+".original."+ext}\"`) + .header("content-disposition", `attachment; filename=\"${id+".original"+ext}\"`) .sendFile(relativePath, basePath); case 'medium': { const meta = await fileTypeFromFile(path.join(basePath, relativePath)); @@ -77,14 +77,14 @@ export default class EntityController { return reply .code(200) .type(meta.mime) - .header("content-disposition", `attachment; filename=\"${id+".medium."+ext}\"`) + .header("content-disposition", `attachment; filename=\"${id+".medium"+ext}\"`) .sendFile(relativePath, basePath); } case 'icon': return reply .code(200) .type('image/jpeg') - .header("content-disposition", `attachment; filename=\"${id+".icon."+ext}\"`) + .header("content-disposition", `attachment; filename=\"${id+".icon"+ext}\"`) .sendFile(relativePath, basePath); default: return reply