Skip to content

Certain text content changes the mime type of txt files. #22363

Closed
@MarkVaughn

Description

@MarkVaughn
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version ~3.2

Some file uploads are failing due to .txt files not being recognized as text
test.txt hello

>>> Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser::getInstance()->guess('pathto/test.txt');
=> "text/plain"

test2.txt HKF9-JX9RXE-U43A4X

>>> Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser::getInstance()->guess('pathto/test2.txt');
=> "application/zlib"

Double checking with bash (osx)

$ file --mime-type pathto/test2.txt 
 pathto/test2.txt: text/plain

a few more tests:

  • HK -> "application/zlib"
  • H -> "application/octet-stream"

Expecting text/plain

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions