Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1016607

    Hello, my client would like me to add his vcf to the website but it wont’s allow me to upload due to security reasons. I can see that there is a way to do it by adding this code to the functions sections

    add_filter(‘upload_mimes’, ‘custom_upload_mimes’);
    function custom_upload_mimes ( $existing_mimes=array() ){
    // add your extension to the array
    $existing_mimes[‘vcf’] = ‘text/x-vcard’; return $existing_mimes;
    }
    however I am very unsure as to how to do that – could you please give me some guidance on this please?

    #1016619

    Hey bauchope,

    I added the code (see below) to your functions.php (at the very bottom, a link to the file can be found in the private content field below)

    
    add_filter('upload_mimes', 'avia_add_vcf_mime');
    function avia_add_vcf_mime( $kb_all_mimes=array() ) 
    {
      $kb_all_mimes['vcf'] = 'text/x-vcard';
      return $kb_all_mimes;
    }
    
    

    Best regards,
    Peter

    #1016630

    thanks very much Dude. It worked a treat

    You can mark this as resolved

    #1016827

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘help required to add vcf to website’ is closed to new replies.