CSV file not uploading on Wordpress

后端 未结 4 1685
再見小時候
再見小時候 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:03

    Define this in wp-config.php.

    define(‘ALLOW_UNFILTERED_UPLOADS’, true)
    

    Add this code to your function.php file

    function enable_extended_upload ( $mime_types =array() ) { $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’; unset( $mime_types[‘exe’] ); unset( $mime_types[‘bin’] ); return $mime_types; } add_filter(‘upload_mimes’, ‘enable_extended_upload’);
    

提交回复
热议问题