{"record":{"id":"00c82a727023cbc6","repo":"strapi/strapi","slug":"wrong-format-uploaded-accepted-formats-only-jpeg","errorCode":null,"errorMessage":"Wrong format uploaded (accepted formats only: jpeg, jpg, png, svg).","messagePattern":"Wrong format uploaded \\(accepted formats only: jpeg, jpg, png, svg\\)\\.","errorType":"validation","errorClass":"ParsingFileError","httpStatus":null,"severity":"warning","filePath":"packages/core/admin/admin/src/pages/Settings/pages/ApplicationInfo/utils/files.ts","lineNumber":33,"sourceCode":"\ninterface ImageDimensions {\n  height: number;\n  width: number;\n}\n\ninterface ImageAsset extends ImageDimensions {\n  ext: string | undefined;\n  size: number;\n  name: string;\n  url: string;\n  rawFile: File;\n}\n\nconst parseFileMetadatas = async (file: File): Promise<ImageAsset> => {\n  const isFormatAuthorized = ACCEPTED_FORMAT.includes(file.type);\n\n  if (!isFormatAuthorized) {\n    throw new ParsingFileError('File format', FILE_FORMAT_ERROR_MESSAGE);\n  }\n\n  const fileDimensions = await new Promise<ImageDimensions>((resolve) => {\n    const reader = new FileReader();\n    reader.onload = () => {\n      const img = new Image();\n      img.onload = () => {\n        resolve({ width: img.width, height: img.height });\n      };\n      img.src = reader.result as string;\n    };\n    reader.readAsDataURL(file);\n  });\n\n  const areDimensionsAuthorized =\n    fileDimensions.width <= DIMENSION && fileDimensions.height <= DIMENSION;\n\n  if (!areDimensionsAuthorized) {","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/strapi/strapi/blob/4a4101264d7098754df36e85fa629fd2f2349d8c/packages/core/admin/admin/src/pages/Settings/pages/ApplicationInfo/utils/files.ts#L15-L51","documentation":"Thrown by parseFileMetadatas when the uploaded file's MIME type is not in ACCEPTED_FORMAT. The error wraps a MessageDescriptor so the admin UI can render a localized message; accepted formats are jpeg/jpg/png/svg per the defaultMessage.","triggerScenarios":"Uploading a webp, gif, bmp, or heic file to the Application Info customization modal (logo / favicon upload).","commonSituations":"Designer exports a webp logo; favicon uploaded as .ico; browser reports a generic MIME type because the extension was renamed.","solutions":["Convert the asset to png, jpg/jpeg, or svg before uploading.","If you need webp/gif support, extend ACCEPTED_FORMAT in ./constants and update the defaultMessage.","Verify the file's actual MIME type (file.type) in the browser devtools before upload.","Strip any renamed extension so the OS-reported MIME type matches the content."],"exampleFix":"// before\nconst ACCEPTED_FORMAT = ['image/jpeg', 'image/png', 'image/svg+xml'];\n// after\nconst ACCEPTED_FORMAT = ['image/jpeg', 'image/png', 'image/svg+xml', 'image/webp'];","handlingStrategy":"validation","validationCode":"const ACCEPTED_FORMAT = ['image/jpeg', 'image/png', 'image/svg+xml'];\nif (!ACCEPTED_FORMAT.includes(file.type)) {\n  // surface a friendly message to the user before upload\n}","typeGuard":"const ACCEPTED_FORMAT = ['image/jpeg', 'image/png', 'image/svg+xml'] as const;\ntype AcceptedMime = typeof ACCEPTED_FORMAT[number];\nfunction isAcceptedMime(m: string): m is AcceptedMime {\n  return (ACCEPTED_FORMAT as readonly string[]).includes(m);\n}","tryCatchPattern":null,"preventionTips":["Validate file.type in the upload component and disable submit on rejection.","Document accepted formats in the upload UI hint text.","Keep ACCEPTED_FORMAT and the localized error message in sync."],"tags":["admin","upload","application-info","validation"],"backgroundTag":null,"analyzedSha":"4a4101264d7098754df36e85fa629fd2f2349d8c","analyzedAt":"2026-08-12T12:47:50.760Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}