[wp-trac] [WordPress Trac] #46544: mp3 file with different file mime type and content type when uploading should not be rejected

WordPress Trac noreply at wordpress.org
Mon Mar 18 11:55:52 UTC 2019


#46544: mp3 file with different file mime type and content type when uploading
should not be rejected
-----------------------------------------+------------------------------
 Reporter:  soleo                        |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Media                        |     Version:  5.1
 Severity:  major                        |  Resolution:
 Keywords:  needs-patch has-screenshots  |     Focuses:
-----------------------------------------+------------------------------

Comment (by subrataemfluence):

 Welcome to trac and thanks for the report!


 {{{
 recording6021333337014136895.mp3 video/mp4
 to_test_on_timby_voice_note.m4a application/octet-stream
 }}}


 The issue with the above files should ideally be fixed by adding right
 associations in `wp_get_mime_types` function inside
 `wp_includes/functions.php` file.


 {{{
 'mp3'   => 'video/mp4',
 'm4a'   => 'application/octet-stream',
 }}}


 The issue with `recording6021333337014136895.mp3 video/mp4` has actually
 resolved by the above approach but the `m4a` one is not responding to it!

 I downloaded few sample `m4a` sample files and they uploaded correctly
 since the mime-types of those are all `audio/x-m4a`, and this is the value
 returned by `get_real_type` function.

 Although adding a correct association should work (`'m4a' => 'application
 /octet-stream'`) and the `mime-type` of your file is indeed `application
 /octet-stream` I am not sure why it is being rejected! However, none of
 the `m4a` files I downloaded is of `application/octet-stream`.

 Can you send another `m4a` of `application/octet-stream` type file for
 further testing please?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46544#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list