如果有帮助:修复Due to safety reasons this file type is not allowed
错误
您需要将此添加到wp-config.php
:
define(\'ALLOW_UNFILTERED_UPLOADS\', true);
dwg MIME有多个,您应该添加所有这些:
function custom_upload_mimes ( $existing_mimes=array() ) {
$existing_mimes[\'dwg\'] = \'image/vnd.dwg\';
$existing_mimes[\'dwg\'] = \'application/acad\';
$existing_mimes[\'dwg\'] = \'application/autocad\';
$existing_mimes[\'dwg\'] = \'application/autocaddwg\';
$existing_mimes[\'dwg\'] = \'application/dwg\';
$existing_mimes[\'dwg\'] = \'drawing/dwg\';
$existing_mimes[\'dwg\'] = \'image/dwg\';
return $existing_mimes;
}
add_filter(\'upload_mimes\', \'custom_upload_mimes\');