Forum


Error uploading .vcf files  

  RSS

dorianhbron
(@dorianhbron)
New Member
Joined: 1 year ago
Posts: 1
13/03/2018 1:27 am  

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.


Quote
leo
 leo
(@leo)
Active Member Admin
Joined: 3 years ago
Posts: 10
27/03/2018 10:01 am  

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. 


ReplyQuote
Share:


We are not industry specific. We are WordPress specific. We work with everyone to help them find solutions with their troubles.
If you show us the problem you are experiencing, we will show you how to fix it. It is that simple.


Reported WordPress issues

  1. How to output custom the file field values on another page with the file download link
  2. Looking for the ability to authorize a credit collection/token on pre sale products
  3. How to automatically activate the plugin while wordpress first installation using docker
  4. How do I perform an IF/ELSE statement using data from a database on wordpress?
  5. How to check if a post or property has been viewed (on each session)
  6. wordpress How do I remove post_ID from user_meta array value
  7. Wordpress hooks working on dashboard but not on actual website
  8. Form echo is not applied of first item in a list
  9. How can I remove unwanted 1px space under navigation bar?
  10. slow down jump to anchor in divi theme

WordPress problems we are working on

  1. Advice on resolving HTTP 500 on WP site?
  2. Copying plugins to base wordpress image, Plugins folders are visible in cmd but not visible in volume mount
  3. how to handel submitted gravity form which contains singel file
  4. How to rearrange WordPress REST API comments?
  5. how to select multi button at same time with different group? [on hold]
  6. WordPress add access for users to edit his comments
  7. Show directories and files in wordpress uploads folder
  8. Insert date and time to custom wordpress mysql table using input type date and input type time by php code
  9. Contact 7 form is causing error in my website afrter updated to the latest wordpress 5.0
  10. How to Add Javascript Code to Button to track the Clicks in Wordpress

Resolved issues

  1. how to print a variable javascript in a onmousedown event?
  2. Contact form 7 WordPress plugin not showing sender email
  3. Does Wordpress list all pages for crawlers?
  4. How to update links on a WordPress website from Google Drive automatically after changing hosts?
  5. some product thumbnails doesn't show up
  6. How to keep the same page for different languages
  7. WordPress : Treat value in functions.php for all inner PHP files
  8. How to echo something after header tag (wordpress)?
  9. Error layout Elementor Wordpress (not load)
  10. APIProjectMapError when using WP Google Map plugin to display map
wppotion - powered by persistence and passion
  
Working

Please Login or Register