Skip to content

Unable to read CSV file because of false postive in mime type detection. #429

Closed
@ravibpatel

Description

What is the expected behavior?

CSV file should be readable even if the mime type of the file doesn't match.

What is the current behavior?

When I try to read a CSV file PhpSpreadsheet was unable to read it cause canRead function returns false.
I am getting "text/x-fortran" as a mime type for my CSV file.

What are the steps to reproduce?

You can find CSV file here.

Possible solution to the problem.

$type = mime_content_type($pFilename);

I suggest you should not rely on this function to test the file. I removed the mime type check and it was able to read the file successfully with "," as a Delimiter.

Which versions of PhpSpreadsheet are affected?

PhpSpreadsheet 1.2.0

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions