|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76254 mime_content_type wrong MIME TYPE
Submitted: 2018-04-23 16:12 UTC Modified: 2021-04-13 11:35 UTC
Avg. Score:3.7 ± 1.9
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: inpost at list dot ru Assigned: cmb (profile)
Status: Not a bug Package: Filesystem function related
PHP Version: 7.2.4 OS:
Private report: No CVE-ID: None
 [2018-04-23 16:12 UTC] inpost at list dot ru
I try upload "wma" file ASF type. Documentation from wiki: 
The most common file extensions for ASF files are extension .WMA (audio-only files using Windows Media Audio, with MIME-type audio/x-ms-wma) and .WMV (files containing video, using the Windows Media Audio and Video codecs, with MIME-type video/x-ms-asf).

mime_content_type and finfo_file return 'video/x-ms-asf', but real: 'audio/x-ms-wma' must be.
Some sites like this: or
return both of mime types! 
If i open file in Windows Media Player, it`s like "only audio file" without video.

It`s must be double mime type, or only audio, not video!

Link to wma file:

Test script:
echo mime_content_type($_FILES['file']['tmp_name']);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-23 16:13 UTC] inpost at list dot ru
Oh, i mean Actual 'video/x-ms-asf' , and Exepcted 'audio/x-ms-wma'
 [2018-04-23 20:18 UTC]
Thanks for the report. Speaking about ext/fileinfo - we rely on the patterns defined by libmagic. Please report this issue upstream, if it's accepted and fixed, it can be integrated/backported for PHP.

According to the doc, the structure of the video and audio files in ASF format is same. Players can of course do a better job, as they also read the codec info.

 [2021-04-13 11:35 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2021-04-13 11:35 UTC]
cmb@ELEPHPANT:~$ file --mime /mnt/c/php-sdk/phpdev/vc15/x64/76254.wma
/mnt/c/php-sdk/phpdev/vc15/x64/76254.wma: video/x-ms-asf; charset=binary

So this looks like an upstream issue, but not a PHP bug.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 11:01:27 2024 UTC