What is MIME type "application/x-dwg"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

application/x-dwg is a MIME type used for AutoCAD drawing files.
It supports vector graphics that store detailed technical designs and blueprints.
Files using this type include DWG for drawings and DWT for templates.
For more details, check out this resource.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: application/x-dwg    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="application/x-dwg">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'application/x-dwg');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

How do I configure my web server to serve application/x-dwg files?

To ensure browsers recognize the file correctly, you must update your MIME type configuration. For Apache, add AddType application/x-dwg .dwg .dwt to your .htaccess file. For Nginx, add application/x-dwg dwg dwt; inside the types block of your nginx.conf.

Can web browsers display application/x-dwg files natively?

No, standard browsers like Chrome, Firefox, and Edge cannot render AutoCAD drawings directly. When a user clicks a link with this MIME type, the browser will usually download the file. To view it online, you must embed a specialized tool like the Autodesk Viewer.

Are there other MIME types used for DWG files besides application/x-dwg?

Yes, because application/x-dwg is a non-standard "x-" type, you might also encounter image/vnd.dwg (the registered subtype), image/x-dwg, or application/dwg. However, application/x-dwg remains very common in legacy web systems.

What software do I need to open a file downloaded as application/x-dwg?

You need Computer-Aided Design (CAD) software to open these files. The industry standard is AutoCAD, but free alternatives include DWG TrueView (for viewing only) or open-source tools capable of reading vector formats.

Why does the browser download the file instead of opening it?

Browsers are configured to download binary files they cannot render. Since application/x-dwg is not a web-safe image format (like PNG or SVG), the browser defaults to the "Save As" behavior to protect the user and ensure the file is handled by the correct desktop application.

Does this MIME type apply to both DWG and DWT files?

Yes, servers often serve both standard drawings (dwg) and drawing templates (dwt) using the application/x-dwg header. The desktop application uses the specific file extension to decide whether to open the file for editing or strictly as a template for a new project.

Are there security risks associated with application/x-dwg files?

Potentially, yes. DWG files can contain embedded VBA macros or scripts that could execute malicious code when opened in full CAD software. It is recommended to scan files from untrusted sources or open them in a restricted "viewer-only" mode.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.