Here is my code that I have placed in the functions.php file, which doesn’t work:
"Sorry, this file type is not permitted for security reasons." What am I doing wrong?
function zerodropout_mime_types( $mime_types ) {
$mime_types['xlsm'] = 'application/vnd.ms-excel.sheet.macroEnabled.12';
return $mime_types;
}
add_filter( 'upload_mimes', 'zerodropout_mime_types', 1, 1 );
2
Answers
WP Upload section is designed for media files. That’s why your code would work for some custom media file type, but not for XLS.
To enable any kind of file you need to disable default upload type limitation by adding this to your wp-config.php
After that your code will work.
This will work: