I was able to upload several .vcf files last month into my WordPress Media Uploader. Now, I keep getting an error that says, "Sorry, this file type is not permitted for security reasons". I updated WordPress and all plugins, and still got the same error. I have downloaded and activated several plugins (only one installed at a time, of course) that claim to allow .vcf files in the MIME type. Still no luck, so I deleted each of the plugins.
WordPress version is now 4.9.4 running Divi Child theme.
Hey, thanks for reporting the case.
This become a well known issue lately. The easiest solution is to add the following line in your wp-config.php file:
define(‘ALLOW_UNFILTERED_UPLOADS’, true)
Another solution is to allow specific file types. This could easily be done by adding the following piece of code to functions.php of your theme. If yourDivi Child theme has its own functions.php file, please add the said code to it. Alternatively you may add it to functions.php part of the parent theme:
function enable_extended_upload ( $mime_types =array() ) {
// The MIME types listed here will be allowed in the media library.
// You can add as many MIME types as you want.
$mime_types[‘gz’] = ‘application/x-gzip’;
$mime_types[‘zip’] = ‘application/zip’;
$mime_types[‘rtf’] = ‘application/rtf’;
$mime_types[‘ppt’] = ‘application/mspowerpoint’;
$mime_types[‘ps’] = ‘application/postscript’;
$mime_types[‘flv’] = ‘video/x-flv’;
// If you want to forbid specific file types which are otherwise allowed,
// specify them here. You can add as many as possible.
unset( $mime_types[‘exe’] );
unset( $mime_types[‘bin’] );
return $mime_types;
}
add_filter(‘upload_mimes’, ‘enable_extended_upload’);
From security point of view, the second option is preferred.
Please give a try to one of these options and let us know is we helped.