CSV file not uploading on Wordpress

后端 未结 4 1730
再見小時候
再見小時候 2021-01-21 10:22

I\'m unable to upload CSV file on the WordPress website

error: Sorry, this file type is not permitted for security reasons

Check the following

4条回答
  •  遇见更好的自我
    2021-01-21 11:05

    In case you are developing a custom theme , add this to your function.php to authorize mimes for uploads :

    function my_custom_mime_types( $mimes ) {
    
    // New allowed mime types.
    $mimes['csv'] = 'text/csv';
    
    // Optional. Remove a mime type.
    unset( $mimes['exe'] );
    
    return $mimes;
    }
    

    Add it to the filter upload_mimes

    add_filter( 'upload_mimes', 'my_custom_mime_types' );
    

    Check here the rest of all mimes type you can authorize.

    The point here is that you are controlling all authorized mimes in your website .

提交回复
热议问题