@@ -124,7 +124,7 @@ class Chatgpt(SimpleService): raise FileUploadUnsupported file_service = FileProcessingService file_bytes = input_message.file.read() - kind = filetype.guess(file_bytes[:20]) + kind = filetype.guess(file_bytes[:550]) if not kind: raise CorruptedFileError raw_file_extension = kind.extension @@ -109,7 +109,7 @@ class Chatgpt_5(Chatgpt): if file: file_service = FileProcessingService file_bytes = input_message.file.read() - kind = filetype.guess(file_bytes[:20]) + kind = filetype.guess(file_bytes[:550]) if not kind: raise CorruptedFileError raw_file_extension = kind.extension @@ -124,7 +124,7 @@ class Chatgpt_5_4(Chatgpt): if file: file_service = FileProcessingService file_bytes = input_message.file.read() - kind = filetype.guess(file_bytes[:20]) + kind = filetype.guess(file_bytes[:550]) if not kind: raise CorruptedFileError raw_file_extension = kind.extension @@ -79,7 +79,7 @@ class Claude(SimpleService): file_service = FileProcessingService try: file_bytes = input_message.file.read() - kind = filetype.guess(file_bytes[:20]) + kind = filetype.guess(file_bytes[:550]) raw_file_extension = kind.extension file_extension = file_service.get_file_extension(raw_file_extension, file_bytes) if file_extension in ('pdf', 'doc', 'docx', 'xlsx'): @@ -136,7 +136,7 @@ class Gemini(SimpleService): if file: file_service = FileProcessingService file_bytes = input_message.file.read() - kind = filetype.guess(file_bytes[:20]) + kind = filetype.guess(file_bytes[:550]) raw_file_extension = kind.extension file_extension = file_service.get_file_extension(raw_file_extension, file_bytes) if file_extension in ('pdf', 'doc', 'docx', 'xlsx'): @@ -86,7 +86,7 @@ class Gemini_3_1(SimpleService): if input_message.file: file_service = FileProcessingService file_bytes = input_message.file.read() - kind = filetype.guess(file_bytes[:20]) + kind = filetype.guess(file_bytes[:550]) raw_file_extension = kind.extension file_extension = file_service.get_file_extension(raw_file_extension, file_bytes) if file_extension in ('pdf', 'doc', 'docx', 'xlsx'): @@ -57,7 +57,7 @@ class Grok_4_1_Fast(SimpleService): if input_message.file: file_service = FileProcessingService file_bytes = input_message.file.read() - kind = filetype.guess(file_bytes[:20]) + kind = filetype.guess(file_bytes[:550]) if not kind: raise CorruptedFileError raw_file_extension = kind.extension @@ -74,7 +74,7 @@ class Qwen_3_5(SimpleService): if input_message.file: file_service = FileProcessingService file_bytes = input_message.file.read() - kind = filetype.guess(file_bytes[:20]) + kind = filetype.guess(file_bytes[:550]) raw_file_extension = kind.extension file_extension = file_service.get_file_extension(raw_file_extension, file_bytes) if file_extension in ('pdf', 'doc', 'docx', 'xlsx'): @@ -80,7 +80,7 @@ class Raifgpt(Chatgpt): if file: file_service = FileProcessingService file_bytes = file.read() - kind = filetype.guess(file_bytes[:20]) + kind = filetype.guess(file_bytes[:550]) if not kind: raise CorruptedFileError raw_file_extension = kind.extension