diff --git a/packages/manager/apps/procedures/src/components/FileInput/FileInput.tsx b/packages/manager/apps/procedures/src/components/FileInput/FileInput.tsx index 58bc7be757f5..8829498d0434 100644 --- a/packages/manager/apps/procedures/src/components/FileInput/FileInput.tsx +++ b/packages/manager/apps/procedures/src/components/FileInput/FileInput.tsx @@ -45,9 +45,16 @@ export const FileInput: FunctionComponent = ({ className }) => { }; const mapToFilesWithError = (files: File[]): FileWithError[] => { + const allowedTypes = accept + .split(',') + .map((type) => type.trim().toLocaleLowerCase()) + .filter(Boolean); + return files.map((fileItem) => { const errorMessages: string[] = []; - if (!accept.includes(fileItem.type)) { + const fileType = fileItem.type?.toLocaleLowerCase(); + + if (allowedTypes.length > 0 && !allowedTypes.includes(fileType)) { const { types, lastType } = parseContentTypes(accept); errorMessages.push( t('account-disable-2fa-file-input-type-file-error', {