{"record":{"id":"3b3c5e5c01f0edeb","repo":"immich-app/immich","slug":"unsupported-file-type-filename","errorCode":null,"errorMessage":"Unsupported file type ${filename}","messagePattern":"Unsupported file type (.+?)","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"warning","filePath":"server/src/services/asset-media.service.ts","lineNumber":88,"sourceCode":"      }\n\n      case UploadFieldName.SIDECAR_DATA: {\n        if (mimeTypes.isSidecar(filename)) {\n          return true;\n        }\n        break;\n      }\n\n      case UploadFieldName.PROFILE_DATA: {\n        if (mimeTypes.isProfile(filename)) {\n          return true;\n        }\n        break;\n      }\n    }\n\n    this.logger.error(`Unsupported file type ${filename}`);\n    throw new BadRequestException(`Unsupported file type ${filename}`);\n  }\n\n  getUploadFilename({ auth, fieldName, file, body }: UploadRequest): string {\n    requireUploadAccess(auth);\n\n    const extension = getFilenameExtension(body.filename || file.originalName);\n    const lookup = {\n      [UploadFieldName.ASSET_DATA]: extension,\n      [UploadFieldName.SIDECAR_DATA]: '.xmp',\n      [UploadFieldName.PROFILE_DATA]: extension,\n    };\n\n    return sanitize(`${file.uuid}${lookup[fieldName]}`);\n  }\n\n  getUploadFolder({ auth, fieldName, file }: UploadRequest): string {\n    auth = requireUploadAccess(auth);\n","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/immich-app/immich/blob/e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c/server/src/services/asset-media.service.ts#L70-L106","documentation":"canUploadFile validates an upload's file extension against the server's allowlist of supported media types (photos, videos, sidecar files). If the filename's extension matches no configured group, it logs and throws a BadRequestException naming the offending file. This is Immich's gate against accepting files it cannot process or store meaningfully.","triggerScenarios":"Calling POST /api/assets (uploadAsset) with a file whose extension is not in any supported-extension list, e.g. .heic when unsupported, .txt, .pdf, .exe, or an extension-less filename.","commonSituations":"Uploading documents or RAW formats not yet supported; users sharing miscellaneous files through Immich; files saved by cameras/apps with unusual extensions; reverse proxies stripping or mangling the original filename.","solutions":["Remove or convert the file to a supported format (JPEG, PNG, HEIC, MP4, MOV, etc.) before uploading.","Check server settings: some formats can be enabled in the asset/video transcoding or upload configuration.","If you control the client, filter the file list by extension before calling the upload API.","Rename the file with a correct extension if it was saved with a wrong/missing one and the content is actually a supported media type."],"exampleFix":"// before\nawait immichApi.uploadFile({ file: new File([data], 'notes.txt') });\n// after\nconst SUPPORTED = /\\.(jpe?g|png|gif|webp|heic|heif|avif|mp4|mov|avi|mkv)$/i;\nif (!SUPPORTED.test(file.name)) throw new Error(`Skipping unsupported file: ${file.name}`);\nawait immichApi.uploadFile({ file });","handlingStrategy":"validation","validationCode":"const SUPPORTED = /\\.(jpe?g|png|gif|webp|heic|heif|avif|dng|mp4|mov|avi|mkv|webm)$/i;\nif (!SUPPORTED.test(file.name)) throw new Error(`Unsupported file type: ${file.name}`);","typeGuard":null,"tryCatchPattern":"try { await upload(file); } catch (e) { if (String(e).includes('Unsupported file type')) skipAndLog(file); else throw e; }","preventionTips":["Filter file pickers with accept attributes for supported media types","Maintain a shared allowlist constant between client and server","Convert exotic formats (RAW, documents) before archiving to Immich"],"tags":["upload","file-type","bad-request","validation"],"backgroundTag":"unsupported-operation","analyzedSha":"e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c","analyzedAt":"2026-09-15T07:20:19.675Z","contentChangedAt":"2026-09-15T07:20:19.675Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}