Moderator
James Huff
(@macmanx)
Volunteer Moderator
I am having the same issue, that plugin does not appear to work on the latest version of WordPress, nor does modifying the functions.php file with the standard code for this you can find throughout the net.
Also having the same issue on an install version 4.9.9
-
This reply was modified 2 years, 2 months ago by
bryanvandy.
Moderator
James Huff
(@macmanx)
Volunteer Moderator
I had the same issue. I was able to resolve it by installing the “Upload File Type Settings” plug-in (https://wordpress.org/plugins/upload-file-type-settings-plugin/) and then entering this, vcf : text/x-vcard, into the Custom Mime Type field.
It is vcard now , without x-
https://github.com/WordPress/WordPress/blob/6fd8080e7ee7599b36d4528f72a8ced612130b8c/wp-includes/class-phpmailer.php#L3600-L3601
so this works
function _thz_enable_vcard_upload( $mime_types ){
$mime_types['vcf'] = 'text/vcard';
$mime_types['vcard'] = 'text/vcard';
return $mime_types;
}
add_filter('upload_mimes', '_thz_enable_vcard_upload' );
-
This reply was modified 2 years, 1 month ago by
Themezly. Reason: code fix
The SVG Files have to have an XML attribute!
I had to put the x- in to get it to work in v5.2.2
This worked for me.
function jberg_enable_vcard_upload( $mime_types=array() ){
$mime_types['vcf'] = 'text/x-vcard';
$mime_types['vcard'] = 'text/x-vcard';
return $mime_types;
}
add_filter('upload_mimes', 'jberg_enable_vcard_upload' );
@jberg1 I tried your code in v5.3 and it doesn’t seem to work. I’m getting the following error: “Sorry, this file type is not permitted for security reasons.” Site is hosted on WP Engine, I’ve purged the cache and have tried multiple times to upload the .vcf file.
Hmm. Still looks to be working for me on WP v5.3. Both with Drag/Drop and selecting the file. Make sure it has the vcf or vcard extension on the file.
Could be an issue with WPEngine.? They do have stricter security rules. I know there are certain plugins they don’t allow, and also require a manual override when using “ORDER BY RAND” in your query. They might be blocking the function for vCard. Wonder if they also block SVG.
@jberg1 Thanks for the quick response. I’ll reach out to WP Engine tomorrow and see if they’d be blocking it from their end.
I’ve received confirmation that WP Engine has to whitelist the vCard file format.
Hello,
Sorry, but what is the whitelist, I have the same pb with my .vcf files, what’s the solution please?
Thanks !!