Adding an autocad .dwg file to a site
-
I was searching for a way to upload DWG files and only found this old, closed thread:
https://www.ads-software.com/support/topic/adding-an-autocad-dwg-file-to-a-siteI tried the solution offered by esmi, but like others mentioned, the solution caused other files types to throw an error on upload. After digging around I found this from the codex:
https://codex.www.ads-software.com/Plugin_API/Filter_Reference/upload_mimesAnd added this code to my functions.php file:
function custom_upload_mimes ( $existing_mimes=array() ) {
$existing_mimes[‘dwg’] = ‘application/dwg’;
return $existing_mimes;
}
add_filter(‘upload_mimes’,’custom_upload_mimes’);This allowed me to upload DWG and all other normal file types without error. Just thought I would post this working solution in case others were looking for the same thing.
- The topic ‘Adding an autocad .dwg file to a site’ is closed to new replies.