I tried to upload a .mp3 file and wordpress rejected and display message:
Sorry, this file type is not permitted for security reasons.
This happened with some .mp3 file only. I'm using wordpress 4.9.6
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityyou need to allow them to be uploaded in your media files.
you can add following code to your themes functions.php
function my_mime_types($mime_types){
$mime_types['mp3'] = 'audio/mpeg';
return $mime_types;
}
add_filter('upload_mimes', 'my_mime_types', 1, 1);
there is more information about adding new mime types in WP here: https://wpsmackdown.com/add-remove-filetypes-wordpress-media-library/#add-filetypes
And here a list of the mime_types: https://feedforall.com/mime-types.htm
application/octet-stream
. it's a official one or also audio/mpeg
should work. updated my post...
Oct 24, 2018 at 10:37