diff --git a/server/apps/immich/src/config/asset-upload.config.ts b/server/apps/immich/src/config/asset-upload.config.ts index 935012d1a3..8d01d4fb0f 100644 --- a/server/apps/immich/src/config/asset-upload.config.ts +++ b/server/apps/immich/src/config/asset-upload.config.ts @@ -1,5 +1,5 @@ import { APP_UPLOAD_LOCATION } from '@app/common/constants'; -import { BadRequestException, UnauthorizedException } from '@nestjs/common'; +import { BadRequestException, Logger, UnauthorizedException } from '@nestjs/common'; import { MulterOptions } from '@nestjs/platform-express/multer/interfaces/multer-options.interface'; import { randomUUID } from 'crypto'; import { Request } from 'express'; @@ -9,6 +9,8 @@ import { extname, join } from 'path'; import sanitize from 'sanitize-filename'; import { patchFormData } from '../utils/path-form-data.util'; +const logger = new Logger('AssetUploadConfig'); + export const assetUploadOption: MulterOptions = { fileFilter, storage: diskStorage({ @@ -30,6 +32,7 @@ function fileFilter(req: Request, file: any, cb: any) { ) { cb(null, true); } else { + logger.error(`Unsupported file type ${extname(file.originalname)} file MIME type ${file.mimetype}`); cb(new BadRequestException(`Unsupported file type ${extname(file.originalname)}`), false); } }