Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cognee/infrastructure/files/utils/guess_file_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ def guess_file_type(file: BinaryIO) -> filetype.Type:
"""
file_type = filetype.guess(file)

# If file type could not be determined consider it a plain text file as they don't have magic number encoding
if file_type is None:
from filetype.types.base import Type

file_type = Type("text/plain", "txt")

if file_type is None:
raise FileTypeException(f"Unknown file detected: {file.name}.")

Expand Down
Loading