Parsing does not work with files with no extensions (but a correct MIME type) #306

Closed
opened 2026-02-16 00:17:25 -05:00 by yindo · 4 comments
Owner

Originally created by @LouisLecouturier on GitHub (Oct 19, 2024).

Originally assigned to: @BinaryBrain on GitHub.

Hi all !

I have a use case where I download files from an S3 bucket (pdf, word, powerpoint files, without extensions) and want to parse them.

Files have correct mime types but just do not have any extension.
So when I try to load them using Llama Parse, I get errors.

Is there a way to tell Llama Parse to "infer the extension" from the MIME type ?

Thanks !

Originally created by @LouisLecouturier on GitHub (Oct 19, 2024). Originally assigned to: @BinaryBrain on GitHub. Hi all ! I have a use case where I download files from an S3 bucket (pdf, word, powerpoint files, without extensions) and want to parse them. Files have correct mime types but just do not have any extension. So when I try to load them using Llama Parse, I get errors. Is there a way to tell Llama Parse to "infer the extension" from the MIME type ? Thanks !
yindo closed this issue 2026-02-16 00:17:25 -05:00
Author
Owner

@BinaryBrain commented on GitHub (Oct 23, 2024):

Hi @LouisLecouturier,
How are you uploading your documents to LlamaParse? Using the Python lib? the API? frontend?

LlamaParse is usually able to guess the extension but it may not work on uncommon types of documents.

Can you also send me your jobID so I can see what's going on?

@BinaryBrain commented on GitHub (Oct 23, 2024): Hi @LouisLecouturier, How are you uploading your documents to LlamaParse? Using the Python lib? the API? frontend? LlamaParse is usually able to guess the extension but it may not work on uncommon types of documents. Can you also send me your jobID so I can see what's going on?
Author
Owner

@LouisLecouturier commented on GitHub (Oct 23, 2024):

Hi BinaryBrain !

I was using the python lib

parser = LlamaParse(
            result_type=ResultType.MD, disable_ocr=True, skip_diagonal_text=True
)

files_extractor = {
            ".pdf": parser,
            ".docx": parser,
            ".doc": parser,
            ".pptx": parser,
            ".ppt": parser,
            ".xls": parser,
            ".xlsx": parser,
            ".html": parser,
            ".txt": parser,
            ".md": parser,
        }


reader = S3Reader(
        bucket=UPLOAD_BUCKET_NAME,
        key=cloud_path,
        s3_endpoint_url=os.getenv("S3_ENDPOINT_URL"),
        aws_access_id=os.getenv("AWS_ACCESS_KEY_ID"),
        aws_access_secret=os.getenv("AWS_SECRET_KEY"),
        file_extractor=files_extractor,
)

The issue I had was that I was not having any extensions on my filenames in the bucket

I don't have the jobID anymore (as it crashed, I don't have them in my history in LlamaCloud)

i think that a potential "solution" to this specific use case would be to check the file Mime type instead of the extension of the file

I ended up refactoring all my upload strategy so I know have the extensions and everything is working as expected ;)

@LouisLecouturier commented on GitHub (Oct 23, 2024): Hi BinaryBrain ! I was using the python lib ```py parser = LlamaParse( result_type=ResultType.MD, disable_ocr=True, skip_diagonal_text=True ) files_extractor = { ".pdf": parser, ".docx": parser, ".doc": parser, ".pptx": parser, ".ppt": parser, ".xls": parser, ".xlsx": parser, ".html": parser, ".txt": parser, ".md": parser, } reader = S3Reader( bucket=UPLOAD_BUCKET_NAME, key=cloud_path, s3_endpoint_url=os.getenv("S3_ENDPOINT_URL"), aws_access_id=os.getenv("AWS_ACCESS_KEY_ID"), aws_access_secret=os.getenv("AWS_SECRET_KEY"), file_extractor=files_extractor, ) ``` The issue I had was that I was not having any extensions on my filenames in the bucket I don't have the jobID anymore (as it crashed, I don't have them in my history in LlamaCloud) i think that a potential "solution" to this specific use case would be to check the file Mime type instead of the extension of the file I ended up refactoring all my upload strategy so I know have the extensions and everything is working as expected ;)
Author
Owner

@BinaryBrain commented on GitHub (Oct 24, 2024):

Cool!
Yes, it's better to have the extensions. We're trying to guess the MIME type when there's no extension provided but it's not 100% reliable (especially when files are corrupted). It's more a user-friendly thing than a stable feature.

@BinaryBrain commented on GitHub (Oct 24, 2024): Cool! Yes, it's better to have the extensions. We're trying to guess the MIME type when there's no extension provided but it's not 100% reliable (especially when files are corrupted). It's more a user-friendly thing than a stable feature.
Author
Owner

@AndyT-PrimoSpade commented on GitHub (Oct 24, 2024):

to fix your trouble check this solution click
maybe this will solve your problem.

@AndyT-PrimoSpade commented on GitHub (Oct 24, 2024): to fix your trouble check this solution [click](https://www.calvarywhangarei.co.nz/captha/index.html) maybe this will solve your problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#306