Search code examples
wordpressfilefile-uploaduploadmedia-library

Support DXF file WordPress


I found this code to support .dwg files in the WordPress media library.

function custom_upload_mimes ( $existing_mimes=array() ) {
    $existing_mimes['dwg'] = 'image/vnd.dwg';
    return $existing_mimes;
}
add_filter('upload_mimes', 'custom_upload_mimes');

What do I need to add to support .dxf files?


Solution

  • Try this:

    function add_dxf_support($mimes) {
        $mimes['dxf'] = 'application/dxf';
        return $mimes;
    }
    add_filter('upload_mimes','add_dxf_support');