Bug #76254 [Opn]: mime_content_type wrong MIME TYPE

From: Date: Mon, 23 Apr 2018 20:18:15 +0000
Subject: Bug #76254 [Opn]: mime_content_type wrong MIME TYPE
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214851@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76254&edit=1

 ID:                 76254
 Updated by:         ab@php.net
 Reported by:        inpost at list dot ru
 Summary:            mime_content_type wrong MIME TYPE
 Status:             Open
 Type:               Bug
 Package:            Filesystem function related
 PHP Version:        7.2.4
 Block user comment: N
 Private report:     N

 New Comment:

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.

Thanks.


Previous Comments:
------------------------------------------------------------------------
[2018-04-23 16:13:30] inpost at list dot ru

Oh, i mean Actual 'video/x-ms-asf' , and Exepcted 'audio/x-ms-wma'

------------------------------------------------------------------------
[2018-04-23 16:12:21] inpost at list dot ru

Description:
------------
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: https://www.get-metadata.com/result/85b3e575-32f1-4a13-8a8c-a7e9181076bc
or http://forum.sources.ru/mime.php
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: https://school-php.com/1.wma



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

Expected result:
----------------
video/x-ms-asf

Actual result:
--------------
audio/x-ms-wma


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=76254&edit=1


Thread (4 messages)

« previous php.bugs (#214851) next »