Standardization of the standard PHP type

Since I am creating a site that is engaged in downloading various types, I come across mime types that do not exist in every OS / browser, and this is unexpected. Examples are image / pjepg (Windows), and more recently, mp3 includes audio / mp 3 (chrome) rather than audio / mpeg.

So, I was wondering if there is a standardization of mime types for PHP? Or is it based on the operating system and browsers?

+5
source share
3 answers

There is a standard for these types, but they are not always effectively used by browsers. For example, Internet Explorer does not support the type "application / javascript", you should use "text / javascript", although this is deprecated.

For types and related documentation, see the following link:

http://www.iana.org/assignments/media-types/index.html

+2
source

You should never trust MIME type information provided by the user, as this is easily tampered with. Depending on what you do with the files, in extreme cases this can lead to buffer overflow attacks against you or your users. You should try to determine the MIME type yourself, for example, using the Finfo functions .

+2
source

, mpe-, RFC (2045, 2046), .

0

All Articles