Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Closed
@MarkVaughn

Description

@MarkVaughn
Issue body actions
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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.