Chat with us, powered by LiveChat

WCMp bundle is available at a slashed price

Grab It Now

import product via CSV

import product via CSV2019-01-14T02:52:41-05:00

Home Support Forum WCMp Advanced Frontend Manager import product via CSV

WCMp Advanced Frontend Manager

import product via CSV Resolved

  • Author
    Posts
  • schnapp-zu.at
    Participant
    Post count: 40

    Hello! If we, as admin, or our vendors via the dashboard want to import products via CSV we always get the following error message: “Unfortunately this file type is not allowed for security reasons.”

    The file is definitely a CSV-file .. so what kind of problem could this be?

    Thanks!

    Attachments:
  • Tech Tycoon Debleena
    Keymaster
    Post count: 488

    @schnapp-zu.at, sorry to hear that you have faced this issue.

    After hearing from you, we did some research on this issue for import. We use the same WooCommerce import flow, for our vendor area too.

    It seems like Prior to 5.0.1, WordPress did not require uploaded files to pass MIME type verification, so files could be uploaded even if the contents didn’t match the file extension. For example, a binary file could be uploaded with a .jpg extension.

    This is no longer the case, and the content of uploaded files must now match their extension. Most valid files should be unaffected, but there may be cases when a file needs to be renamed to its correct extension (e.g., an OpenOffice doc going from .pptx to .ppxs).

    Many users have reported this to WooCommerce, as you can check here – https://github.com/woocommerce/woocommerce/issues/22208#issuecomment-446869717

    As a workaround, they are asking to install this plugin – https://wordpress.org/plugins/disable-real-mime-check/

    So, please install this plugin and check if the issue has been fixed. (It is recommended to do the tests in staging site first)

    We will also see how WooCommerce is handling this and how we can also take care of this issue with the latest WordPress.

  • webmaster.mid
    Participant
    Post count: 48

    Just solved this exactly same problem. The combination of both of those solutions worked correctly for me:

    @ functions.php

    ## Disables MIME Types Check ##

    function wph_disable_mime_check($data,$file,$filename,$mimes){
       $wp_filetype = wp_check_filetype($filename,$mimes);
       $ext = $wp_filetype['ext'] ;
       $type = $wp_filetype['type'] ;
       $proper_filename = $data['proper_filename'] ;
       return compact('ext','type','proper_filename');
    }
    add_filter('wp_check_filetype_and_ext','wph_disable_mime_check',10,4);

    @ wp-config.php

    ## Allows uploading different types of file, such as .csv ##
    define('ALLOW_UNFILTERED_UPLOADS', true);

    Hope it helps you and anyone else who needs to fix this before WP fixes it in its core. =)

  • schnapp-zu.at
    Participant
    Post count: 40

    Thank you very much for your help!! It is working now 🙂

  • Tech Tycoon Debleena
    Keymaster
    Post count: 488

    Thanks @webmaster.mid, for helping out @schnapp-zu.at

The topic ‘import product via CSV’ is closed to new replies.