Php doesn't return the correct mime type

前端 未结 5 1802
没有蜡笔的小新
没有蜡笔的小新 2020-12-20 18:02

The finfo function is returning crazy mime types. Look the following code, what is going on?



        
5条回答
  •  青春惊慌失措
    2020-12-20 18:03

    I recently faced a situation where an uploaded text file was wrongly recognized as "text/x-c++" because it began with the keyword class . It was correctly recognized as "text/plain" with another first word. It was indeed probably related to the browser recognition algorithm, as this also occurred on this website : https://htmlstrip.com/mime-file-type-checker

提交回复
热议问题