Support for capitalized file extensions such as PDF (#146)

This commit is contained in:
Shan 2023-05-25 17:58:38 -04:00 committed by GitHub
parent 20ed6183b9
commit 7adcdd3d51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 1 deletions

Binary file not shown.

View File

@ -81,7 +81,7 @@ async def filter_file(file: UploadFile, enable_summarization: bool, supabase_cli
elif file.file._file.tell() < 1:
return {"message": f"{file.filename} is empty.", "type": "error"}
else:
file_extension = os.path.splitext(file.filename)[-1]
file_extension = os.path.splitext(file.filename)[-1].lower() # Convert file extension to lowercase
if file_extension in file_processors:
await file_processors[file_extension](file, enable_summarization)
return {"message": f"{file.filename} has been uploaded.", "type": "success"}