I have an old school user who wants to upload an excel file to our WordPress page.
Basically, WordPress does not allow this.
Upon
https://gist.github.com/robwent/e3bf00bafe7a00bc3d0c4dceabde4fca
I put the following into functions.php before the end “Includes”:
function my_custom_mime_types( $mimes ) {
// New allowed mime types.
$mimes['xls'] = 'application/vnd.ms-excel';
return $mimes;
}
add_filter( 'upload_mimes', 'my_custom_mime_types', 9999 );
But upon uploading an .xls file I get an error message that due to security this is not allowed (re-translated from my native language).
Was this an attempt in the right direction? How can I make this work?